Some of our users asked for a capability to fetch old push notifications when opening an app, which can be used for various purposes:
- to process custom data from the notification payload
- to display latest unopened messages in the app
- to open Pushwoosh Rich Pages within the app when it’s launched directly from the home screen
Today we have updated our PhoneGap plugin (CLI) to v3.4.2, and it features experimental getPushHistory()
and clearPushHistory()
methods exactly for these purposes (available for Android only).
By calling these methods you can receive a JSONArray of pushes that have arrived to the app. Note that only the last 10 pushes are being kept there. Please also make sure you are calling the clearPushHistory
as you fetch the array.