Cross platform ( iOS and Android ) chat does not work with chat21 SDK

195 Views Asked by At

We are using chat-SDK chat21 for android and iOS.

https://github.com/chat21/chat21-ios-demo

https://github.com/chat21/chat21-android-sdk

Under my firebase account, I have 2 applications 1 for android and another for iOS.

For Android, we are using google-service.json file with App ID.

For iOS, we are using GoogleService-info.plist file for configuration chat21 SDK

But, When I do message from android the iOS does not receive any message the same thing happening from iOS to android application.

It's because we are using different applications? ( project settings -> Your apps section ) both have different App ID though App ID is only used In android application.

The internal chat I mean iOS to iOS and android to android chat works absolutely fine cross-platform chat does not work.

enter image description here

enter image description here

Let me know if I am lacking something in configuration so can fix quickly thanks

Updates 02 JULY

enter image description here

FirebaseDatabase.getInstance().setPersistenceEnabled(true);

ChatManager.startWithEmailAndPassword(this, [APP_ID],
[YOUR_EMAIL], [YOUR_PASSWORD], new ChatAuthentication.OnChatLoginCallback() {
@override
public void onChatLoginSuccess(IChatUser currentUser) {
ChatManager.getInstance().createContactFor(currentUser.getId(), currentUser.getEmail(),
[YOUR_FIRST_NAME], [YOUR_LAST_NAME], new OnContactCreatedCallback() {
@override
public void onContactCreatedSuccess(ChatRuntimeException exception) {
if (exception == null) {
ChatUI.getInstance().openConversationsListActivity();
} else {
// TODO: handle the exception
}
}
});
}

@override
public void onChatLoginError(Exception e) {
// TODO: 22/02/18
}
}); 

Above android code which uses app id to connect with firebase and in iOS getting app_id from plist file. both APP_Id are different.

1

There are 1 best solutions below

0
On BEST ANSWER

By replacing APP_ID with "chat" (the same name of the iOS tree).Previously, I was using Firebase APP_ID, which refers to Firebase. This is the tenant name of my app and must be the same for all the clients using chat. which resolved the problem! Thanks to the team!