Skip to content

Instantly share code, notes, and snippets.

@naishe
Created August 2, 2020 09:42
Show Gist options
  • Save naishe/8f95ac9312d9f5cdadc42af45e7872f6 to your computer and use it in GitHub Desktop.
Save naishe/8f95ac9312d9f5cdadc42af45e7872f6 to your computer and use it in GitHub Desktop.
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