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

How to get UID of user in CCSingleChatActivity #9

Closed
imdBhargav opened this issue Nov 26, 2018 · 1 comment
Closed

How to get UID of user in CCSingleChatActivity #9

imdBhargav opened this issue Nov 26, 2018 · 1 comment

Comments

@imdBhargav
Copy link

I have imported 'CometChatUI' module in my project to modify some UI.
My requirement is
suppose my name is 'A' and I am chatting with user named 'B'.
In a One-to-one chat, when I clicked on View profile to see 'B' user's profile. I want to redirect the user A to my app to see the user B's profile. I do not want to open CometChat profile screen

I am registering and login an user into CometChat from uid. (and this uid is user id from our app)
Now in CCSingleChatActivity I want to get that uid from which the user B logged in.
But unfortunatlely, I am not getting that uid of user B.

I have tried
contactId,
contact.cometid,
contact.id

But not getting the uid from which user is logged into the CometChat.

Can you please advice how to get uid of user in CometChat

@jitvarpatil jitvarpatil self-assigned this Nov 26, 2018
@jitvarpatil
Copy link
Contributor

Hi @imdBhargav,

You are getting the UID in contact list jsonObject you receive in gotOnlineList() callback of subscribe method, You can find that in CCSubcribe.class. Following in the Contact object you get in the gotOnlineList() method:

{"id":"***","uid":"****","n":"*****","l":"","a":"\"\"","d":0,"s":"offline","m":"I'm offline","g":"","ls":"","lstn":"","ch":"*******************","rdrs":0,"role":"******","custom":""}

However we are not saving UID in local Database and hence you are not able to access that using the contact object in CCSingleChatActivity. You can create a new database field and access it in CCSingleChatActivity.

If you have any further queries. you can schedule a session and we can work on resolving your issue. You can schedule a session at the following link:

https://www.cometchat.com/schedule-session/

Thank You

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