Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

[Android] on('notification') 'coldstart' value is acting wacky and not as documented (works only on iOS) #2939

Open
livesemantics opened this issue Jul 28, 2020 · 0 comments

Comments

@livesemantics
Copy link

livesemantics commented Jul 28, 2020

Expected Behaviour

According to the documentation: data.additionalData.coldstart: Will be true if the application is started by clicking on the push notification, false if the app is already started.

Actual Behaviour

On iOS, coldstart behaves as expected.
On Adnroid, when app in background and receiving notifications from FCM with only data section that includes "title", "message" and some app specific data.

  1. If payload also contains "content-available": "1" then on('notification') is always fired with "coldstart":true, "foreground":false when app receives notification in the background, and also when user clicks on the notification.

  2. If payload contains "content-available": "0" then on('notification') is fired only when user clicks on the notification (as expected) but with "coldstart":false, "foreground":false.

Platform and Version

Android Version: 10
Device: Samsung Galaxy A series
Cordova CLI: 9.0.3
Cordova android version: 8.1.0
phonegap-plugin-push: 2.3.0
(Sending push from AWS-SNS using FCM for Android and APNS for iOS)

Sample Push Data Payload

{
"data": {
"title": "my title",
"message": "my message",
"notId": 206891,
"collapse_key": "2231900",
"time_to_live": 86400,
"content-available": "1",
"lastUpdate": "2020-07-28T08:53:14Z",
"data-key-1": 2231900,
"data-key-2": [... array of numbers ...]
}
}

@livesemantics livesemantics changed the title [Android] on('notification') is not working as expected [Android] on('notification') payload contains 'coldstart':true in background notifications with 'content-available': '1' Jul 28, 2020
@livesemantics livesemantics changed the title [Android] on('notification') payload contains 'coldstart':true in background notifications with 'content-available': '1' [Android] on('notification') 'coldstart' value is acting wacky and not as documented (works only on iOS) Jul 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant