0
私はiOSアプリケーションを設定するためにGoogle Firebaseのルールに従います。私が使用されていないFirebaseコンソールデバイスID(トークン)に与える場合は、通知が私のアプリでキャッチ、しかしのUserInfoは空です:/* HERE */
コメントに伴い、アプリの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)
}
userInfoがnil
であるためクラッシュします。
Firebaseコンソールから別の通知をもう一度やり直すと、通知はキャッチされず、何も追加されません(受信通知機能にブレークポイントがあります)。
どういうところが間違っていますか?