我用fire-base发送通知,在ios应用程序中,我有这个错误:发送没有注册侦听器的FcmTokenRefreshed,如果应用程序打开收到通知,但当应用程序关闭时没有收到并显示错误。
对不起,我的英语不好!
"react":"16.4.1“
"react-native":"0.55.4“
"react-native-fcm":"^16.2.4",
"xcode 10.1“
发布于 2018-11-04 16:54:43
请确保将以下代码行放入您的
文件: AppDelegate.m:
1)
import "RNFirebaseNotifications.h"
import "RNFirebaseMessaging.h"2)将此行添加到didFinishLaunchingWithOptions RNFirebaseNotifications configure中;
3)添加方法
(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
[[RNFirebaseNotifications instance] didReceiveLocalNotification:notification];
}
(void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
[[RNFirebaseNotifications instance] didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
(void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
[[RNFirebaseMessaging instance] didRegisterUserNotificationSettings:notificationSettings];
}https://stackoverflow.com/questions/53138825
复制相似问题