eclipsesource / tabris-plugin-firebase

A firebase plugin for Tabris.js
https://tabrisjs.com
BSD 3-Clause "New" or "Revised" License
6 stars 5 forks source link

LaunchData Broken on Android #65

Open raphaelpreston opened 5 years ago

raphaelpreston commented 5 years ago

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

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

mpost commented 5 years ago

We are looking into the issue. How did you send the cloud message?