Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Integrating CodePush 7 (iOS 1)
// file name: ios/ThatMate/AppDelegate.m
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
+#import <CodePush/CodePush.h> // CodePush
// --- code not shown for brevity ---
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
- #ifdef FB_SONARKIT_ENABLED
- return
- [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"
- fallbackResource:nil];
-#else
- return [[NSBundle mainBundle] URLForResource:@"main"
- withExtension:@"jsbundle"];
-#endif
+ #if DEBUG
+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
+ #else
+ return [CodePush bundleURL];
+ #endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment