Leanplum / Leanplum-Android-SDK

Leanplum's integrated solution delivers meaningful engagement across messaging and the in-app experience.
https://www.leanplum.com
Apache License 2.0
46 stars 40 forks source link

Integrate FCM 22.0.0. #465

Closed JayShortway closed 3 years ago

JayShortway commented 3 years ago
What Where/Who
JIRA Issue N/A
People Involved Just me

Notes on PR descriptions

Background

firebase-messaging 22.0.0 deprecates the FirebaseInstanceId class, which is used by LeanplumFcmProvider. This causes a crash in apps that implement firebase-messaging 22.0.0 together with Leanplum 5.7.0.

Implementation

This PR implements firebase-messaging 22.0.0 by changing the references to FirebaseInstanceId in LeanplumFcmProvider to FirebaseMessaging.

Testing steps

All tests should still pass, including LeanplumPushServiceTest. Moreover, this change successfully sets a push token for our device, visible on Leanplum's web client. We also receive push notifications as expected.

Is this change backwards-compatible?

Unfortunately, this change is not backwards-compatible with versions of firebase-messaging before 22.0.0. Please let me know if you want to accommodate for that, and the preferred way of doing so. I will try to implement your suggestions.

hborisoff commented 3 years ago

@JayShortway, thank you for your PR. We are aware of the change that needs to be done, but the latest FCM package, supporting these new methods, is still not old enough to require our clients to update to it. Check my PR #454. Currently we support FCM up to 21.1.0. We'll update it to use the new methods in several months.

JayShortway commented 3 years ago

@hborisoff, alright makes sense. Thanks for the info. Looking forward to the update!