hansemannn / titanium-firebase-cloud-messaging

Use the Firebase Cloud Messaging SDK in Axway Titanium 🚀 Edit
Other
43 stars 31 forks source link

fix(android): Update dependency #127

Closed m1ga closed 3 years ago

m1ga commented 3 years ago
m1ga commented 3 years ago

still have to test it but I've updated this and core. Will run some tests later

m1ga commented 3 years ago

Screenshot_20210514-213216 was a bit scared first since the data messages didn't arrive...but I was just using the wrong notification channel :facepalm:

Looking good. With firebase-core, 9.3.2.GA and 10.0.0. Data and notification messages arrive.

hansemannn commented 3 years ago

Pretty cool! Any useful features / enhancements we could add?

hansemannn commented 3 years ago

Oh, and this change should be double checked (foreground / background):

Screenshot 2021-05-14 at 21 50 21

Docs to the Android 12 breaking change are here: https://developer.android.com/about/versions/12/behavior-changes-12#notification-trampolines

m1ga commented 3 years ago

I don't see any differences inside my app or in the way the push opens. There is just one line missing in the log when I click on a notification (the one with -----> in before )

before:

ActivityTaskManager: START u0 {flg=0x24000000 cmp=com.miga.testfirebase/firebase.cloudmessaging.PushHandlerActivity (has extras)} from uid 10742
-----> ActivityTaskManager: startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { flg=0x24000000 cmp=com.miga.testfirebase/firebase.cloudmessaging.PushHandlerActivity (has extras) }
ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.miga.testfirebase cmp=com.miga.testfirebase/.Test_firebase_messagingActivity (has extras)} from uid 10742
ActivityTaskManager: Duplicate finish request for r=ActivityRecord{7e36b3d u0 com.miga.testfirebase/firebase.cloudmessaging.PushHandlerActivity t35747 f}}
TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.miga.testfirebase.Test_firebase_messagingActivity@8e9ce80
TiAPI   :  test_firebase_messaging 1.0 (Powered by Titanium 10.0.0.6a0cfa55f5)
ActivityTaskManager: Displayed com.miga.testfirebase/.Test_firebase_messagingActivity: +290ms
ActivityTaskManager: START u0 {cmp=com.miga.testfirebase/org.appcelerator.titanium.TiActivity (has extras)} from uid 10742
ActivityTaskManager: Displayed com.miga.testfirebase/org.appcelerator.titanium.TiActivity: +319ms

after this PR:

ActivityTaskManager: START u0 {flg=0x14000000 cmp=com.miga.testfirebase/firebase.cloudmessaging.PushHandlerActivity (has extras)} from uid 10742
ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.miga.testfirebase cmp=com.miga.testfirebase/.Test_firebase_messagingActivity (has extras)} from uid 10742
ActivityTaskManager: Duplicate finish request for r=ActivityRecord{c55ac97 u0 com.miga.testfirebase/firebase.cloudmessaging.PushHandlerActivity t35750 f}}
TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.miga.testfirebase.Test_firebase_messagingActivity@2a2527c
TiAPI   :  test_firebase_messaging 1.0 (Powered by Titanium 10.0.0.6a0cfa55f5)
ActivityTaskManager: Displayed com.miga.testfirebase/.Test_firebase_messagingActivity: +271ms
ActivityTaskManager: START u0 {cmp=com.miga.testfirebase/org.appcelerator.titanium.TiActivity (has extras)} from uid 10742
ActivityTaskManager: Displayed com.miga.testfirebase/org.appcelerator.titanium.TiActivity: +311ms

I still see the data in lastData and onMessage is called inside the Ti app.

Will have a look at the trampoline stuff at the weekend

m1ga commented 3 years ago

@hansemannn If you didn't find any issues this one can be merged, too.

hansemannn commented 3 years ago

@m1ga Please release on Github, thx!