Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit b08e987

Browse files
author
Richard Hua
committed
Fix issue where restarts did not happen on IMMEDIATE installs
1 parent 6d2abd1 commit b08e987

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ios/CodePush/CodePush.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ @implementation CodePush {
6464

6565
+ (void)initialize
6666
{
67+
[super initialize];
6768
if (self == [CodePush class]) {
6869
// Use the mainBundle by default.
6970
bundleResourceBundle = [NSBundle mainBundle];
@@ -231,7 +232,6 @@ + (void)setUsingTestConfiguration:(BOOL)shouldUseTestConfiguration
231232

232233
#pragma mark - Private API methods
233234

234-
@synthesize bridge = _bridge;
235235
@synthesize methodQueue = _methodQueue;
236236
@synthesize pauseCallback = _pauseCallback;
237237
@synthesize paused = _paused;
@@ -255,7 +255,7 @@ - (void)setPaused:(BOOL)paused
255255
- (void)clearDebugUpdates
256256
{
257257
dispatch_async(dispatch_get_main_queue(), ^{
258-
if ([_bridge.bundleURL.scheme hasPrefix:@"http"]) {
258+
if ([super.bridge.bundleURL.scheme hasPrefix:@"http"]) {
259259
NSError *error;
260260
NSString *binaryAppVersion = [[CodePushConfig current] appVersion];
261261
NSDictionary *currentPackageMetadata = [CodePushPackage getCurrentPackage:&error];
@@ -434,18 +434,18 @@ + (BOOL)isPendingUpdate:(NSString*)packageHash
434434
*/
435435
- (void)loadBundle
436436
{
437-
// This needs to be async dispatched because the _bridge is not set on init
437+
// This needs to be async dispatched because the bridge is not set on init
438438
// when the app first starts, therefore rollbacks will not take effect.
439439
dispatch_async(dispatch_get_main_queue(), ^{
440440
// If the current bundle URL is using http(s), then assume the dev
441441
// is debugging and therefore, shouldn't be redirected to a local
442442
// file (since Chrome wouldn't support it). Otherwise, update
443443
// the current bundle URL to point at the latest update
444-
if ([CodePush isUsingTestConfiguration] || ![_bridge.bundleURL.scheme hasPrefix:@"http"]) {
445-
[_bridge setValue:[CodePush bundleURL] forKey:@"bundleURL"];
444+
if ([CodePush isUsingTestConfiguration] || ![super.bridge.bundleURL.scheme hasPrefix:@"http"]) {
445+
[super.bridge setValue:[CodePush bundleURL] forKey:@"bundleURL"];
446446
}
447447

448-
[_bridge reload];
448+
[super.bridge reload];
449449
});
450450
}
451451

0 commit comments

Comments
 (0)