Others

We have redesigned our APIs in the 2.x version, now you can support your users in a more friendly way.

To help you upgrade from version 1.x to version 2.x, we will take several commonly used scenarios as examples to show your the difference.

Unread messages #

ELvaChatServiceSdk.setUnreadMessageFetchUid(userId);
ELvaChatServiceSdk.setOnMessageArrivedCallback(new ELvaChatServiceSdk.OnMessageArrivedCallback() {
    @Override
    public void onMessageArrived(String str) {
        // str -> {"flag":true, "data":{"cs_message_count":0}}
      	// cs_message_count is your unread message count
    }
});
AIHelpSupport.startUnreadMessageCountPolling(new OnMessageCountArrivedCallback() {
    @Override
    public void onMessageCountArrived(int msgCount) {
        // msgCount > 0 when there are unread messages,
        // msgCount = 0 when all unread messages are read by user.
    }
});

Push #

// APNS(1), FIREBASE(2), JPUSH(3), GETUI(4)
ELvaChatServiceSdk.setPushToken("push_token", 1);
// APNS, FIREBASE, JPUSH, GETUI
AIHelpSupport.setPushTokenAndPlatform("push_token", PushPlatform.FIREBASE);

Network check #

ELvaChatServiceSdk.setNetCheckInfo("aihelp.net", new ELvaChatServiceSdk.OnNetworkPingCallback() {
    @Override
    public boolean onNetworkPingResult(String result) {
        return false;
    }
});
AIHelpSupport.setNetworkCheckHostAddress("aihelp.net", new OnNetworkCheckResultCallback() {
    @Override
    public void onNetworkCheckResult(String netLog) {

    }
});

Upload log #

ELvaChatServiceSdk.setAllowUploadLogMessageCallback(new ELvaChatServiceSdk.OnAllowUploadLogMessageCallback() {
    @Override
    public void onAllowUploadLogMessage() {
        ELvaChatServiceSdk.uploadLogFromPath("log_path");
    }
});
AIHelpSupport.setUploadLogPath("log_path");