Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 什么是AppDelegate实现?推送通知_React Native - Fatal编程技术网

React native 什么是AppDelegate实现?推送通知

React native 什么是AppDelegate实现?推送通知,react-native,React Native,这方面的文档并不清楚 然后在AppDelegate实现中添加以下内容: 是指将此代码放在下面的@implementation AppDelegate中,如下所示: #import "RCTPushNotificationManager.h" #import "AppDelegate.h" #import "RCTRootView.h" @implementation AppDelegate // Required to register for notifications - (void)

这方面的文档并不清楚

然后在AppDelegate实现中添加以下内容:

是指将此代码放在下面的
@implementation AppDelegate
中,如下所示:

#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

谢谢

是,它应该在AppDelegate的@implementation中

这是使用PushNotificationIOS的应用程序中的AppDelegate.m