Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 1.99 KB

4.1.md

File metadata and controls

35 lines (29 loc) · 1.99 KB

Version 4.1 migration guide

Minimum SDK version

In order to use newer Android APIs the minimum supported API level has been raised to 15, which covers devices running Android 4.0.3 and newer.

Session refreshing

It is no longer necessary to call DDNA.instance().newSession() as the SDK has added an automatic session refreshing mechanism, which is enabled by default. If you would like to handle the session refreshing manually then you may disable it during the initialisation step.

DDNA.initialise(new DDNA.Configuration(
        this,
        "environmentKey",
        "collectUrl",
        "engageUrl")
        .withSettings(new DDNA.SettingsModifier() {
            @Override
            public void modify(Settings settings) {
                // disables session refreshing
                settings.setSessionTimeout(0);
            }
        }));

Engage and Image Messaging

The API for performing Engage and Image Message requests has been updated to better match the dynamic nature of the returned data. Instead of returning back the JSON response in the listener, the Engagement which was used for performing the request will now be returned in the listener's onCompleted(Engagement) method. The instance will be populated with information from the server's response and an ImageMessage object can be created, if applicable, or the response JSON can be accessed.

The requestImageMessage(...) methods have also been deprecated in favour of requestEngagement(...), to reflect the changes in the API.

For more details on the updated APIs please take a look here and here.

Notifications

To simplify integration of the notifications library we have made the versioning consistent with the analytics SDK. You will now need to declare the two dependencies with the same version, and nothing else will need to be changed.

compile 'com.deltadna.android:deltadna-sdk:4.1.0'
compile 'com.deltadna.android:deltadna-sdk-notifications:4.1.0'