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

Allow usage of custom FirebaseMessagingService #432

Closed hborisoff closed 3 years ago

hborisoff commented 3 years ago
What Where/Who
JIRA Issue SDK-201
People Involved @hborisoff

Background

  1. Extracted Leanplum specific code from LeanplumPushFirebaseMessagingService into LeanplumFirebaseServiceHandler containing:

    • onCreate
    • onNewToken
    • onMessageReceived
  2. To implement custom FirebaseMessagingService you have to copy LeanplumPushFirebaseMessagingService and include the following code in your manifest file:

    
    <!-- Disable the default Leanplum FCM message handling service -->
    <service
    xmlns:tools="http://schemas.android.com/tools"
    android:name="com.leanplum.LeanplumPushFirebaseMessagingService"
    android:enabled="false"
    tools:replace="android:enabled"/>

<service android:name="your.package.Copy_of_LeanplumPushFirebaseMessagingService" android:enabled="true" android:exported="false">



3. Removed `LeanplumCloudMessagingProvider.isManifestSetup` functionality as it is not necessary anymore because receivers and services are added to library's manifest file which is merged into the project's manifest.

4. Replaced deprecated usage of Firebase API with the recommendations by Google