Skip to content

Commit feb463e

Browse files
authored
Merge pull request #2 from chlee1001/bugfix/ios-reload-new-architecture
✨ (ios/CodePush): integrate RCTReloadCommand for improved reload handling
2 parents 144b023 + 4dc0acb commit feb463e

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,5 @@ Examples/testapp_rn
192192

193193
# Android debug build files (conflict ignoring #Visual Studio files)
194194
!android/app/src/debug/
195+
196+
**/*.tgz

ios/CodePush/CodePush.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#import <React/RCTEventDispatcher.h>
66
#import <React/RCTRootView.h>
77
#import <React/RCTUtils.h>
8+
#import <React/RCTReloadCommand.h>
89
#else // back compatibility for RN version < 0.40
910
#import "RCTAssert.h"
1011
#import "RCTBridgeModule.h"
@@ -31,7 +32,7 @@ @implementation CodePush {
3132
long long _latestExpectedContentLength;
3233
long long _latestReceivedConentLength;
3334
BOOL _didUpdateProgress;
34-
35+
3536
BOOL _allowed;
3637
BOOL _restartInProgress;
3738
NSMutableArray *_restartQueue;
@@ -376,7 +377,7 @@ - (instancetype)init
376377
_allowed = YES;
377378
_restartInProgress = NO;
378379
_restartQueue = [NSMutableArray arrayWithCapacity:1];
379-
380+
380381
self = [super init];
381382
if (self) {
382383
[self initializeUpdateAfterRestart];
@@ -540,7 +541,7 @@ - (void)loadBundle
540541
[super.bridge setValue:[CodePush bundleURL] forKey:@"bundleURL"];
541542
}
542543

543-
[super.bridge reload];
544+
RCTTriggerReloadCommandListeners(@"react-native-code-push: Restart");
544545
});
545546
}
546547

0 commit comments

Comments
 (0)