diff --git a/Examples/SampleApp/iOS/SampleApp.xcodeproj/project.pbxproj b/Examples/SampleApp/iOS/SampleApp.xcodeproj/project.pbxproj index bb15add6fc7518..e08861ebee4c26 100644 --- a/Examples/SampleApp/iOS/SampleApp.xcodeproj/project.pbxproj +++ b/Examples/SampleApp/iOS/SampleApp.xcodeproj/project.pbxproj @@ -597,7 +597,8 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/../../../React/**", + "$(SRCROOT)/../../Libraries/**", + "$(SRCROOT)/../../React/**", ); INFOPLIST_FILE = "$(SRCROOT)/SampleApp/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -613,7 +614,8 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/../../../React/**", + "$(SRCROOT)/../../Libraries/**", + "$(SRCROOT)/../../React/**", ); INFOPLIST_FILE = "$(SRCROOT)/SampleApp/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; diff --git a/Examples/SampleApp/iOS/SampleApp/AppDelegate.m b/Examples/SampleApp/iOS/SampleApp/AppDelegate.m index 7e8d5fecfb2915..2d18acb792dddd 100644 --- a/Examples/SampleApp/iOS/SampleApp/AppDelegate.m +++ b/Examples/SampleApp/iOS/SampleApp/AppDelegate.m @@ -13,6 +13,8 @@ @implementation AppDelegate +Class RCTPushNotificationManager = nil; + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSURL *jsCodeLocation; @@ -49,6 +51,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( moduleName:@"SampleApp" launchOptions:launchOptions]; + RCTPushNotificationManager = NSClassFromString(@"RCTPushNotificationManager"); + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [[UIViewController alloc] init]; rootViewController.view = rootView; @@ -57,4 +61,18 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( return YES; } +- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken +{ + if(RCTPushNotificationManager){ + [RCTPushNotificationManager application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; + } +} + +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification +{ + if(RCTPushNotificationManager){ + [RCTPushNotificationManager application:application didReceiveRemoteNotification:notification]; + } +} + @end