Last modified November 16, 2017 by Shelly Wolfe

Android SDK 5.0 upgrade guide

With the release of Swrve’s Android SDK version 5.0, we have made major changes to the APIs to ensure internal consistency and improve SDK integration. This guide outlines the APIs that we have changed or deprecated.

Changed Summary
The SwrveSDK.createInstance methods now take an Application param instead of a Context. All createInstance methods take Application instead of Context param.
Removed
SwrveSDK.onCreate(final Activity activity) This method is now automatic.
SwrveSDK.onResume(Activity activity) This method is now automatic.
SwrveSDK.onPause() This method is now automatic.
SwrveSDK.onDestroy(Activity activity) This method is now automatic.
SwrveSDK.onLowMemory() This method is no longer needed.
SwrveSDK.onNewIntent() This method is no longer needed.
Deprecated SwrveSDK.processIntent This method was already deprecated and no longer needed.
Deprecated class SwrveAdmConstants Use com.swrve.sdk.SwrvePushConstants instead.
Deprecated com.swrve.sdk.gcm.ISwrvePushNotificationListener Use com.swrve.sdk.ISwrvePushNotificationListener instead.
Some deprecated constants in SwrveGcmConstants Moved some constants to com.swrve.sdk.SwrvePushConstants.
Deprecated method setLanguage(Locale locale) from ISwrve Use SwrveSDK.setLanguage(Locale locale) instead.
Deprecated method SwrveSDK.getMessageForEvent(String event) This method is no longer needed.
Deprecated method SwrveSDK.getMessageForId(int messageId) This method is no longer needed.
Deprecated method public String getAutoShowEventTrigger() This method is no longer needed.
talkEnabled property from SwrveConfig This method is no longer needed.
Renamed To
ISwrvePushNotificationListener SwrvePushNotificationListener
ABTestDetails SwrveABTestDetails
ISwrveResourcesListener SwrveResourcesListener
ISwrveUserResourcesDiffListener SwrveUserResourcesDiffListener
ISwrveUserResourcesListener SwrveUserResourcesListener
ISwrveCustomButtonListener SwrveCustomButtonListener
ISwrveInstallButtonListener SwrveInstallButtonListener
ISwrveMessageListener SwrveMessageListener
ISwrveConversationListener SwrveConversationListener
Refactored To
ISwrvePushNotificationListener.
onPushNotification(Bundle bundle);
SwrvePushNotificationListener.
onPushNotification(JSONObject payload);