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

Commit 0eb8eab

Browse files
committed
Simplify loadBundle
1 parent 631894c commit 0eb8eab

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

CodePush.m

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,10 @@ - (BOOL)isFailedHash:(NSString*)packageHash {
5252

5353
- (void)loadBundle
5454
{
55-
dispatch_async(dispatch_get_main_queue(), ^{
56-
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:[CodePush getBundleUrl]
57-
moduleName:[CodePushConfig getRootComponent]
58-
initialProperties:nil
59-
launchOptions:nil];
60-
61-
UIViewController *rootViewController = [[UIViewController alloc] init];
62-
rootViewController.view = rootView;
63-
[UIApplication sharedApplication].delegate.window.rootViewController = rootViewController;
64-
});
55+
// Reset the runtime's bundle to be
56+
// the latest URL, and then force a refresh
57+
_bridge.bundleURL = [CodePush getBundleUrl];
58+
[_bridge reload];
6559
}
6660

6761
- (void)rollbackPackage

0 commit comments

Comments
 (0)