-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Problem description
LaunchData isn't set on Android upon launching the app through a notification.
Here is the console output after being launched with a notification tap on Android:
> Firebase token: <token>
> No launch data received.
Expected behavior
Here is the console output after being launched with a notification tap on iPhone:
> Firebase token: <token>
Custom Launch Data Detected: { aps:
{ alert:
{ title: <title>,
body: <body> } },
'gcm.notification.data': '{<myCustomData>}',
'google.c.a.e': '1',
optinaldata1: 'value',
'gcm.message_id': <id> }
Environment
- Tabris.js version: 3.0.0-beta2-dev.20190306
- Devices tested:
- iPhone 7 with iOS 11.1.1
- HTC Desire 530 with Android 6.0.1
- Pixel 3XL with Android 9
Code snippet
/* ask for permissions */
if (device.platform == 'iOS') firebase.Messaging.requestPermissions();
console.log("Firebase token: " + firebase.Messaging.token);
setTimeout(() => { // workaround for Issue #41
if (typeof firebase !== "undefined") {
if (typeof firebase.Messaging.launchData !== "undefined" && firebase.Messaging.launchData) {
console.log("Custom Launch Data Detected: ", firebase.Messaging.launchData);
}
else {
console.log("No launch data received.");
}
}
});
Workaround for #41
Metadata
Metadata
Assignees
Labels
No labels