drcode
drcode

Reputation: 3357

Detecting arrival of push notification with Trigger.io

I'm building an android app with trigger.io. When a push notification is received while the app is in the foreground, I need to detect this in order to update information in the app.

As far as I can tell, the documentation says this is possible, via the messagePushed event. As per the documentation, this event is "triggered when a push notification is received both while the application is running or if the application is launched via that notification."

However, in my testing this even ONLY fires when the application is launched via the notification. The event does NOT fire if the app is in the foreground. (I am using the standard way to detect this event with "forge.event.messagePushed.addListener")

Can someone tell me if I am doing something wrong, or misunderstand the documentation, or if this is a bug in trigger.io?

Upvotes: 1

Views: 964

Answers (1)

Amir Nathoo
Amir Nathoo

Reputation: 1866

The difference between the receipt behaviour on Android and iOS was actually a symptom of the Parse SDK - it used to be you could only specify an Activity (in our case, your app) to be opened when the user goes to select the system tray notification.

In more recent Parse SDKs, they've added to this so that an app can be notified of inbound pushes at receipt time.

We've haven't updated our API and Parse module to support that yet. I'll open a ticket and report back here when that change is available in a new platform version

Upvotes: 1

Related Questions