0
我遵循Google Firebase中的规则来配置我的iOS应用。当我给它从未被使用过的火力地堡控制台设备ID(标记),该通知是由我的应用程序捕获,但用户信息为空:Firebase消息iOS:usersInfo为空或我从未收到通知
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject],
fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
// If you are receiving a notification message while your app is in the background,
// this callback will not be fired till the user taps on the notification launching the application.
// TODO: Handle data of notification
// Print message ID.
print("Message ID: \(userInfo["gcm.message_id"]!)") /* HERE */
// Print full message.
print("%@", userInfo)
}
在与/* HERE */
评论,应用程序行由于userInfo是nil
而崩溃。
当我再次尝试从Firebase控制台发出另一个通知时,通知未被捕获并且没有附加任何内容(我在接收通知功能中有一个断点)。
怎么了?