Updating the SDK

From 2.x.x to 3.x.x

Google Cloud Messaging integration changes

Starting with version 3, WebEngage SDK uses a separate Push Receiver for handling messages from GCM. So, below changes are required only if the value of meta data tag com.webengage.sdk.android.auto_gcm_registration is set to true in your AndroidManifest.xml.

  1. Remove WebEngageReceiver from AndroidManifest.xml.
<meta-data
    android:name="com.webengage.sdk.android.auto_gcm_registration"
    android:value="true" />       
<!--<receiver-->
    <!--android:name="com.webengage.sdk.android.WebEngageReceiver"-->
    <!--android:permission="com.google.android.c2dm.permission.SEND">-->
    <!--<intent-filter>-->
        <!--<action android:name="com.google.android.c2dm.intent.RECEIVE" />-->
        <!--<action android:name="com.webengage.sdk.android.intent.ACTION" />-->
        <!--<category android:name="YOUR.PACKAGE.NAME" />-->
    <!--</intent-filter>-->
<!--</receiver>-->
  1. Add WebEngagePushReceiver in your AndroidManifest file under application tag.
<receiver
    android:name="com.webengage.sdk.android.WebEngagePushReceiver"
    android:permission="com.google.android.c2dm.permission.SEND">
    <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        <category android:name="${applicationId}" />
    </intent-filter>
</receiver>

From 1.x.x to 2.x.x

  1. Default value of meta-data com.webengage.sdk.android.auto_gcm_registration has been changed from true to false. If above meta-data is not present in your AndroidManifest.xml file then insert the same by following our Push Notification set-up guide.
  2. WebEngage.get().setRegistrationID(String registrationID, String projectNumber) has been deprecated. Use WebEngage.get().setRegistrationID(String registrationID). setRegistrationID now only accepts GCM/FCM registered token.

From (SDK version <= 1.7) to (SDK version >= 1.8)

  1. Remove WebEngageCallback annotation from all your callback implementations.
  2. Manually register your push, in-app and lifecycle callback implementations to WebEngage.
  3. Remove below lines from your ProGuard file.
-keep class * implements com.webengage.sdk.android.callbacks.PushNotificationCallbacks{*;}
-keep class * implements com.webengage.sdk.android.callbacks.LifeCycleCallbacks{*;}
-keep class * implements com.webengage.sdk.android.callbacks.InAppNotificationCallbacks{*;}