Brand Messenger Android SDK 1.11.0

Date: November 11, 2022

Updates

Added anonymous users

Anonymous users can be used to start conversations with an agent without authentication. They have an expiry time.

Logging in an anonymous user

To log in an anonymous user, refer to the code given below:

if BrandMessengerManager.isAnonymousUserExpired() { 
    BrandMessengerManager.loginAnonymousUser { response, error in  }
}

This code checks if the anonymous user is valid (not expired) and logs-in.

Authenticating an anonymous user

To authenticate an anonymous user and merge the conversation you can login with an authenticated user like this:

BrandMessengerManager.login("accessToken") { response, error in }

If you do not want the conversations to be merged you can call login with a false mergeConversations flag as shown below:

BrandMessengerManager.login("accessToken", mergeConversations: false) { response, error in }

Alternatively, you can also use loginWithJWT instead of login (with accessToken) to perform the same actions.

With merge:

BrandMessengerManager.loginWithJWT("jwt", userId: "userId") { response, error in }

Without merge:

BrandMessengerManager.loginWithJWT("jwt", userId: "userId", mergeConversations: false) { response, error in }