Closed anija closed 2 years ago
The problem was in another place at all.
messaging().onMessage(async remoteMessage => {
PushNotification.localNotification({
title: remoteMessage.notification?.title,
message: remoteMessage.notification?.body||'',
userInfo: remoteMessage.data,
});
});
I was missing userInfo here.
I've tried a lot of solutions I've found on this repository, but nothing seems to works.
I've a remote notification with the data object filled up with some data. If the app is on background, i can get the full data object:
Console result:
But when the app is on foreground, the notification is redirected as a local notification and is missing the data info:
Console result:
I think that the problem is in file AppDelegate.m, here:
I got two different logs of userInfo: first time is complete, second time is empty.
Can someone help me on this? Thank you so much :)