I am following react-native-codepush doc to add the following block to AppDelegate.m in React native 0.68.0/Xcode 13:
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [CodePush bundleURL];
#endif
}
Here is the AppDelegate.m after change:
#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>
#import <CodePush/CodePush.h> /* for rn codepush */
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
@property (nonatomic, strong) UIWindow *window;
/* for rn code push */
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [CodePush bundleURL];
#endif
}
@end
However there is error saying: Expected ';' after method prototype. I am not an expert on Xcode/IOS, what is really missing here?