eclipsesource / eclipsesource/tabris-plugin-firebase
LaunchData Broken on Android
- Dominant language
- JavaScript
- Stars
- 6
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
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:
```html
> Firebase token:
> No launch data received.
```
### Expected behavior
Here is the console output after being launched with a notification tap on iPhone:
```html
> Firebase token:
Custom Launch Data Detected: { aps:
{ alert:
{ 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
```javascript
/* 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.");
}
}
});
```
<sub>Workaround for #41</sub>
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.