Je suis les règles de Google Firebase pour la configuration de mon application iOS. Quand je donne à la console Firebase un ID de périphérique (de jeton) qui n'a jamais été utilisé, la notification est pris par mon application, mais le userInfo est vide:Messagerie Firebase iOS: usersInfo est vide ou je ne reçois jamais la notification
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)
}
Sur la ligne avec le commentaire /* HERE */
, l'application se bloque car userInfo est nil
. Lorsque j'essaie à nouveau une autre notification de la console Firebase, la notification n'est pas interceptée et rien ne s'y ajoute (j'ai un point d'arrêt dans la fonction de notification de réception).
Qu'est-ce qui ne va pas?