-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notificationId in PushPayload is null for iOS #215
Comments
If you are trying to get the notification ID from a content-available push in the background, Apple does not deliver that id with the callback that we are given to listen for that event. There is a limitation on the Airship SDK where we are dropping the ID if the push is received in the foreground in the callback that we need to expose it to flutter. We can look into addressing that but it will take some time. |
@rlepinski yes, the is no notificationId with a content-available push in the background as well as in the foreground. |
We wont be able to provide you the notification ID in the background for content-available push, only when the device is in the foreground. A workaround would be to set your own unique ID, then use the |
@AnastasiiaSob I don't think we can solve your issue with just adding the foreground ID, that would catch some of it but the majority of the time notifications will be received in the BG. I think instead you should use this solution - #200 (comment) Then use onPushReceived, onForeground events to pull your data from that store. That would be the most reliable way of getting the list of notifications |
@rlepinski thank you for your suggestion! We found out that in |
Preliminary Info
What Airship dependencies are you using?
airship_flutter: ^7.7.1
What are the versions of any relevant development tools you are using?
Flutter 3.22.3
Report
What unexpected behavior are you seeing?
After sending a push notification from Airship to my physical iOS device and calling
Airship.push.onPushReceived.listen((event) {...}
I get aPushPayload
Object that contains the propertynotificationId
with a null value. I can see the push notification on my screen and I see the payload in my console.For example:
PushPayload( notificationId=null, alert=TEXT from Airship, title=title from airship, subtitle=null, extras={ com.urbanairship.metadata: eyJ2ZXJ...., com.urbanairship.media_attachment: {url: [......] }, ^u: https://www.google.com})
What is the expected behavior?
After sending a push notification from Airship to my physical iOS device and calling
Airship.push.onPushReceived.listen((event) {...}
I assume to get aPushPayload
Object that contains a not-null propertynotificationId
.What are the steps to reproduce the unexpected behavior?
Send a push notification to an iOS device while the app is in foreground and active. Access the
PushPayload
Objectevent.pushPayload
in theonPushReceived
listener. The push notification is not a silent push.Do you have logging for the issue?
In the info above.
The text was updated successfully, but these errors were encountered: