Open wolfenrain opened 5 years ago
@wolfenrain notId
is a legacy field that this plugin uses on Android. For iOS you should use the tag
property. For example:
{
"delayWhileIdle": false,
"collapseKey": "testKey",
"priority": "high",
"dryRun": false,
"notification": {
"title": "Chat message",
"body": "hello",
"badge": 2,
"tag": "my-tag"
}
}
@macdonst I have done some testing with the tag
key included, but haven't succeeded yet.. Not sure if I am still missing something. I could also not find anything about the tag
key you mentioned, neither in the PushPlugin docs nor Apple docs, so if you could point me in a direction for that, much obliged.
Here is my current payload:
{
"delayWhileIdle": false,
"collapseKey": "testKey",
"priority": "high",
"dryRun": false,
"data": {
"notId": 2097162,
"color": "#6ECFF6",
"ledColor": [0, 110, 207, 246],
"fullscreen": "0",
"content-available": "1",
"no-cache": "0"
},
},
"notification": {
"title": "Chat message",
"body": "hello",
"badge": 1,
"tag": "2097162"
},
"timeToLive": 25
}
Shouldn't it be apns-collapse-id
, see: https://medium.com/the-guardian-mobile-innovation-lab/how-to-replace-the-content-of-an-ios-notification-2d8d93766446
Expected Behaviour
That when using the
notId
the notification will be replaced on iOS.Actual Behaviour
I just get a new notifiction instead of the old one replaced.
Reproduce Scenario (including but not limited to)
Send this Android payload using FCM to an Android device:
This will go exactly as expected, the notification will be received, if you send it again but with a different body, you will get a replaced notification. As expected
Send this iOS payload using FCM:
You will receive a notification, but when you change the body and send the notification again, you get another one instead of it being replaced.
Steps to Reproduce
See Reproduce Scenario.
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
Android 8 and iOS 12.1
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
Motorola
Cordova CLI version and cordova platform version
cordova:
8.0.1-nightly.2018.8.31.dfd2fe79 (cordova-lib@8.0.1-nightly.2018.8.31.d93cfa77)
cordova android:7.1.1
cordova ios:4.5.5
Plugin version
2.2.3, but with current master code.
Sample Push Data Payload
See Reproduce Scenario.
Sample Code that illustrates the problem
test script to easily test(duh)
Logs taken while reproducing problem