Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shashankshahplutus opened this issue Jun 30, 2020 · 4 comments

Comments

@shashankshahplutus
Copy link

shashankshahplutus commented Jun 30, 2020

Hi! there!

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

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.

Functions logs are as below.

image

image

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

@sponzillo
Copy link
Contributor

Please check your database realtime database to see the messages tassonomy, very easy to understand.
Probably you didn't use the same "app_id" (aka tenant) for both apps.

Andrea

@shashankshahplutus
Copy link
Author

shashankshahplutus commented Jul 1, 2020

Hey @sponzillo Thanks for getting back to me!

image

Also, I am sharing an android code to connect with chat system.

` 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
}
}); `

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

@sponzillo
Copy link
Contributor

Hi,

ChatManager.startWithEmailAndPassword(this, [APP_ID],
[YOUR_EMAIL], [YOUR_PASSWORD], new ChatAuthentication.OnChatLoginCallback() {
@OverRide

replace APP_ID with "chat" (the same name of the iOS tree). Don't use the Firebase APP_ID, that refers to Firebase.
This is the tenant name of you app and must be the same for all the clients using tyou chat.

Let me know.

@shashankshahplutus
Copy link
Author

shashankshahplutus commented Jul 2, 2020

Hi, @sponzillo thanks for your reply!

We have set both end android and iOS to connect with the "chat" node & it works like charm!

Screenshot 2020-07-02 at 11 48 31 AM

Yes, now we are using the same node for chatting! I am able to get the messages into cross-platform. Thanks for your help @sponzillo appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants