Use Android Live Updates. A Live Update is an ongoing, progress-style notification that Android shows on the lock screen, in the notification drawer, and as a status bar chip. It refreshes in place as the activity moves forward.
Requirements:
- Android 16 (API 36) or newer. On older devices, Live Update calls do nothing.
- Pushwoosh Android SDK 6.9.0 or later with the
pushwoosh-liveupdatesmodule added to app/build.gradle. No extra initialization code is needed.
Your backend drives the whole lifecycle through Messaging API v2: add a live_update object to the android content block of a transactional request. Set live_update.op to:
OPERATION_STARTto post the notification,OPERATION_UPDATEto refresh it silently,OPERATION_ENDto dismiss it.
All pushes for one activity must share the same live_update.id. Each push fully describes the notification, so resend every field you want to keep (for example, segments and the icon) with each update.
In the app, PushwooshLiveUpdates.endLiveUpdate(id) dismisses an update locally, getActiveIds() lists the ones on screen, and endAllLiveUpdates() clears all of them.
Don't use Live Updates for promotions or chat messages: Android may revoke the app's ability to post promoted notifications.
Learn more: Live Updates on Android
Comments
0 comments
Please sign in to leave a comment.