Can someone who knows the answer please respond to my question?
To ask the question again with different wording: I can successfully send push notifications to iOS and Android devices. In both cases, if the application is not running, notifications are delivered to the notification centre (iOS) or notification tray (Android). If I now open the application by tapping the application icon, any previously delivered notifications are NOT forwarded to the application. This is contrary to what the documentation says and contrary to a comment by @Uldris in another thread on this topic.
So, is it the expected behaviour that previously delivered notifications will be forwarded to the application (and I’m doing something wrong) or is the documentation incorrect?
@aeq Many thanks for your reply. I ran into problems getting Fuse Studio 1.9 working with some the underlying project libraries (qr reader, popups) but fuse-open is different, I guess.
As it works for you, it is worth me putting the effort in to get to the latest version.
@aeq - I’ve upgraded to Fuse Studio 1.9. I have not compiled local libraries - installing 1.9 also installs the libraries which I assume are the latest.
The behaviour did not change so I wiped the entire machine of every trace of fuse and installed from scratch just to be sure…
The behaviour is still the same - notifications are not forwarded to the application unless 1) the application is running or 2) you tap the notification popup which then opens up the application.
In the case that I am describing, I do not get notifications forwarded to the application. Can someone on the fuse team tell me if this is expected behaviour or not. Here again is the scenario (this is for iOS but the same applies to Android):
Application is not running
A notification is sent
A notification popup shows on the device
The user does nothing; notification popup goes away
Later, the user taps the application icon to open up the application
The previously received notification is NOT delivered to the application
The previously received notification IS removed from the notification centre
@aeq - let me ask again about your set up - in the above scenario, at step 5, does your application get the previously received notification(s) delivered to the application?
@acoad oh I see what you mean, no, at step 5 the notification and its payload is sitting in the users notification tray. Only if they then tap the notification, then the payload is received by the app as soon as it opens or if it was previously open.
What I do is once my user opens the app, I do a check for notifications and update the amount in my internal notifications icon and if they check the internal notifications list, I clear all notifications in the tray as well as the app icon badge.
One last question: “What I do is once my user opens the app, I do a check for notifications and update the amount…” Do you dip into native code to do this or is there a way to do it in fuse?
@aeq - that won’t work. I need the messages already in the Notification centre and, once pulled into the app, I need to delete them from Notification centre.
Oh haha, just needed to confirm that we’re on the same page.
The user just needs to tap on the notification in the notification centre, which will then trigger the received event that you can listen for, then when you receive it, just call clearAllNotifications(): https://fuse-open.github.io/docs/fuse/pushnotifications/push.html
User sees the badge and taps the application icon to open the application expecting to see what it was that caused the badge
Alas, the push notification is not in the application so the user experience is broken
It looks pretty clear to me now that there is no way of pulling in already delivered push notifications through Fuse - I need to write some native code to do that. I know how to do that for iOS; for Android, I have no clue but I’m going to have to figure it out