我已根据其网站上的说明实施了Firebase云消息传递。所以当我从这里生成通知时:
在branch_a
我已将AppDelegate.swift
函数添加为:
didReceiveRemoteNotification
我实施的其他方法是
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
Messaging.messaging().appDidReceiveMessage(userInfo)
print(userInfo)
completionHandler(UIBackgroundFetchResult.newData)
}
func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String)
func messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage)
我的func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
有:
didFinishLaunchingWithOptions