Migration From Old Dengage Sdk

Class Imports

You can change class imports with respect to table below.

Old SdkNew Sdk
com.dengage.sdk.DengageLifecycleTrackercom.dengage.sdk.util.DengageLifecycleTracker
com.dengage.sdk.NotificationReceivercom.dengage.sdk.push.NotificationReceiver
com.dengage.sdk.FcmMessagingServicecom.dengage.sdk.push.FcmMessagingService
com.dengage.sdk.HmsMessagingServicecom.dengage.sdk.push.HmsMessagingService
com.dengage.sdk.Constantscom.dengage.sdk.util.Constants
com.dengage.sdk.models.Messagecom.dengage.sdk.domain.push.model.Message
com.dengage.sdk.models.CarouselItemcom.dengage.sdk.domain.push.model.CarouselItem
com.dengage.sdk.models.InboxMessagecom.dengage.sdk.domain.inboxmessage.model.InboxMessage
com.dengage.sdk.models.Subscriptioncom.dengage.sdk.domain.subscription.model.Subscription
com.dengage.sdk.models.DengageErrorcom.dengage.sdk.callback.DengageError
com.dengage.sdk.models.TagItemcom.dengage.sdk.domain.tag.model.TagItem

Renamed DengageManager Class

Sdk's main class named DengageManager is renamed as Dengage. Also you don't need to get
instance of DengageManager class and keep it as parameter anymore. You can just call functions
of sdk like Dengage.functionName.

Removal of DengageEvent Class

DengageEvent class removed. DengageEvent functions moved to Dengage class.

Example:

// In old sdk 
DengageEvent.getInstance(context).pageView(data) 

// In new sdk
Dengage.pageView(data)

Initiation of Dengage

Changed initiation of the sdk. You should just call init function with parameters.

Example:

// In old sdk 
DengageManager
    .getInstance(applicationContext)
    .setFirebaseIntegrationKey(FIREBASE_APP_INTEGRATION_KEY)
    .init()

// In new sdk
Dengage.init(
    context = applicationContext,
    firebaseIntegrationKey = FIREBASE_APP_INTEGRATION_KEY,
    huaweiIntegrationKey = HUAWEI_APP_INTEGRATION_KEY, /* Optional */
    firebaseApp: FirebaseApp? /* Optional */
)

// the new sdk also has support of DengageManager wrapper class so you current implementation won't be effected if you are migrating.

Removed Methods and Alternatives

We removed, renamed or moved some methods in new sdk. You should make changes for migration with
respect to table below.

Old SdkNew SdkExplanation
DengageManager.initWithFirebaseInstanceDengage.initNew init method contains an optional parameter named firebaseApp
DengageManager.isGooglePlayServicesAvailableConfigurationUtils.isGooglePlayServicesAvailableMethod moved from manager class to utils of configuration
DengageManager.isHuaweiMobileServicesAvailableConfigurationUtils.isHuaweiMobileServicesAvailableMethod moved from manager class to utils of configuration
DengageManager.setPermissionDengage.setUserPermissionMethod is removed, you should use new one
DengageManager.subscribeDengage.setTokenMethod is removed, you should use new one
DengageManager.buildSubscription-You don't need to call this function anymore
DengageManager.saveSubscription-You don't need to call this function anymore
DengageManager.syncSubscription-You don't need to call this function anymore

NotificationReceiver Updated

  • Simplified carousel rendering. We have only one function named onCarouselRender for setting
    push messages with carousel content. Removed old method named onCarouselReRender. Changed
    image downloading methods of sdk. Removed some calculations for carousel content. Our sample
    receiver PushNotificationReceiver

  • You can override rich or text notification methods on your notification receiver class for using
    custom notifications (Optional)
    Example:

override fun onRichNotificationRender(
    context: Context,
    intent: Intent,
    message: Message,
    bitmap: Bitmap,
    notificationBuilder: NotificationCompat.Builder
) {
    // do not call super
    // do your custom implementation
}

override fun onTextNotificationRender(
    context: Context, 
    intent: Intent, 
    message: Message, 
    notificationBuilder: NotificationCompat.Builder
) {
    // do not call super
    // do your custom implementation
}