Closed m1ga closed 1 year ago
Are there any side effects / regression that this could cause? I'm very cautious these days 👍
I'm still testing why this is like this.
The default category (printing launcherIntent.getCategories() here) is {android.intent.category.LAUNCHER}
and I add an action to the category so it looks like this:
{android.intent.action.MAIN, android.intent.category.LAUNCHER}
.
I'm not sure why the ACTION in the category works and just leaving it at the defaults won't.
Before this PR:
Titanium.Android.currentActivity.intent.getStringExtra("fcm_data")
is nullTitanium.Android.currentActivity.intent.getStringExtra("fcm_data")
is filledAfter this PR:
Titanium.Android.currentActivity.intent.getStringExtra("fcm_data")
after clicking on the notificationWhen there is a gcm.n.analytics_data
field in the notification there was an error:
ERROR] JNIUtil: !!! Unable to convert unknown Java object class ‘android.os.Bundle’ to JS value !!!
when reading the lastData
property. That property contains a Bundle and not just a value. I've mapped that to
[INFO] 'gcm.n.analytics_data_from': '47582xxxx',
[INFO] 'gcm.n.analytics_data_google.c.a.e': '1',
now.
Added toString()
for the return values. That will fix e.g. a problem in combination with ti.nfc. The FCM module will read the NFC intent and can't handle that data. With toString()
it won't crash anymore. Might also happen with other modules that call the app via Intent
This looks like a change in app behavior, forcing this to be a major update, e.g. 4.0.0. And it would be great to have some more external testing on this before merging.
Fine to merge after we get the 3.x releases with the open patches out. Then we have these changes available to both users (3.x and 4x users).
closed in favor of https://github.com/hansemannn/titanium-firebase-cloud-messaging/pull/147
Change the launcher category from
Intent.CATEGORY_LAUNCHER
toIntent.ACTION_MAIN
. This will triggerwhen the app was in the background (still running) and you click on the notification. Before it was empty unless the app was closed.
firebase.cloudmessaging-android-4.0.0.zip