2016-07-14 8 views
0

これに関するドキュメントは明確ではありません。あなたのAppDelegateの実装でAppDelegate実装とは何ですか? PushNotificationIOS

https://facebook.github.io/react-native/docs/pushnotificationios.html

そして、次の行を追加します。

#import "RCTPushNotificationManager.h" 
#import "AppDelegate.h" 
#import "RCTRootView.h" 

@implementation AppDelegate 

// Required to register for notifications 
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { [RCTPushNotificationManager didRegisterUserNotificationSettings:notificationSettings]; } // Required for the register event. 
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { [RCTPushNotificationManager didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; } // Required for the notification event. 
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification { [RCTPushNotificationManager didReceiveRemoteNotification:notification]; } // Required for the localNotification event. 
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { [RCTPushNotificationManager didReceiveLocalNotification:notification]; } - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { NSLog(@"%@", error); } 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 

{ 
    NSURL *jsCodeLocation; 

    ... 
} 

@end 

ありがとう:

それはこのように@implementation AppDelegateの下にこのコードを置くことに言及されています!

答えて

1

はい、AppDelegateの@implementation内にある必要があります。ここで

My AppDeligate.m

PushNotificationIOS を使用してアプリで私のAppDelegate.mです
関連する問題