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 set with delay on cold app launch #41

Closed cpetrov closed 4 years ago

cpetrov commented 6 years ago

Problem description

firebase.Messaging.launchData is not set immediately on cold app launch (app killed and being started by tapping on a notification banner), but after a delay.

Expected behavior

launchData should be set even when the app is cold-launched.

Environment

Code snippet

Insert the following on the top of app.js:

console.log('launchData: ' + firebase.Messaging.launchData);
setTimeout(() => {
  console.log('launchData after timeout: ' + firebase.Messaging.launchData);
});

The timeouted console.log will log the expected launchData. The first console.log will log undefined.

karolszafranski commented 6 years ago

Tabris.js iOS platform is missing a hook to introduce a nice and clean change where possibly the issue could be fixed. If we would have a hook called "before applicationDidFinishLaunching", we could possibly put [ESFBMessaging setLaunchData:launchOptions]; there. Of course, it's possible to do it without the hook in the comment, but it would be better to wait for the changes in the platform first.

With that change first console.log does print the object, and not undefined value.

mpost commented 5 years ago

Is this issue still relevant?

anselm0 commented 4 years ago

Any progress on this? I am currently having issues with launchData on iOS. When user taps the notification, no data is logged on both cold and warm start (app in background) of the application.

patrykmol commented 4 years ago

Fixed with https://github.com/eclipsesource/tabris-plugin-firebase/commit/ad5d68876ced6990fd7a830b0448f01721ed6da9.