Android SDK always created a new chat and can't comeback to previously created | Community
Skip to main content

Android SDK always created a new chat and can't comeback to previously created

  • September 30, 2022
  • 0 replies
  • 0 views

abu

I want to comeback to previously created chat when its not ended. But whenever i try to go to zendesk activity it will always created a new one even when using the same email, phone number or even using tags.
Here is my code sample

Chat.INSTANCE.init(context,
accountKey);

VisitorInfo visitorInfo = VisitorInfo.builder()
.withName(telechatActiveAppointment.getContactName())
.withEmail(telechatActiveAppointment.getEmail_address())
.withPhoneNumber(telechatActiveAppointment.getContact_phone()) // numeric string
.build();

ChatProvidersConfiguration chatProvidersConfiguration = ChatProvidersConfiguration.builder()
.withVisitorInfo(visitorInfo)
.build();

Chat.INSTANCE.setChatProvidersConfiguration(chatProvidersConfiguration);

ArrayList<String> list = new ArrayList<>();
list.add(getDecodedBase64(telechatActiveAppointment.getAppointmentId()));

Chat.INSTANCE.providers().profileProvider().addVisitorTags(list, new ZendeskCallback<Void>() {
@Override
public void onSuccess(Void result) {
Log.i("Success ", "Success send list " + result);
}

@Override
public void onError(ErrorResponse error) {
Log.i("Error ", "Error send list " + error);
}
});