App42 Buddy Service

0 votes
I am currently working on the project which use the buddy service as the back end
 
I have a question about the buddy service api "getAllMessages" and "sendMessageToFriend".
 
The phenomenon is that after I log in user A, I send a message M  from A to B (A and B are already friends) with sendMessageToFriend, it seems correct (as console displays, the username is A and buddy name is B)
 
Then I log into B, and call getAllMessages, the.message M should have been there, but it isn't.
 
More surprisingly, when I log into A again and call getAllMessages, I found that the message M is there on A's display console! (as console displays, the username is A and buddy name is NULL)  "getAllMessages" seems to fetch those messages of the sender instead of the receiver.
 
I am not sure if I have called the wrong api, but what is the way to get those messages which a specific user receives from all his friends?
asked Jun 3, 2014 in App42 Cloud API-BaaS by Bob Anoop (19 points)
recategorized Oct 24, 2014 by sushil

2 Answers

+1 vote
Hi Bob,

Can you share logs details when you call the getAllMessages api for B.

When you call the getAllMessages function the buddyName is always null because response format only contains the name of user who receive the message as userName and the owner of the message as ownerName.
answered Jun 4, 2014 by hs00105 (517 points)
Now qaz@gmail.com logs in
Message sent from "qaz@gmail.com" to "qwerty@gmail.com" by calling sendMessageToFriend("qaz@gmail.com", "qwerty@gmail.com", "send message: to qwerty@gmail.com", app42CallBack);
Log: userName:qaz@gmail.com buddyName:qwerty@gmail.com ownerName:null message:538f7f5be4b04324ae024d79--"send message: to qwerty@gmail.com"

Message received by calling getAllMessages("qaz@gmail.com", app42CallBack):
Log: userName:qaz@gmail.com buddyName:null ownerName:qaz@gmail.com message:538f7f51e4b0b33395a7bbca--send message: to qwerty@gmail.com (previous msg)
Log: userName:qaz@gmail.com buddyName:null ownerName:qaz@gmail.com message:538f7f57e4b0381595201478--send message: to qwerty@gmail.com (previous msg)
Log: userName:qaz@gmail.com buddyName:null ownerName:qaz@gmail.com message:538f7f5be4b04324ae024d79--send message: to qwerty@gmail.com (current msg)


Now qwerty@gmail.com logs in
Message received by calling getAllMessages("qwerty@gmail.com", app42CallBack):
Nothing...
Hi Bob,

You need to replace the special character from user name & buddy name parameter.
That's why the message is not received on the other hand.
Do let me know if it helps or you need any other information regarding this.
Note : - Avoid the special character in user name & buddy name for further use.
Hi,
Which special character are you referring to? "." or "@" ?
0 votes
Have the same problem. Please help.
answered Jun 4, 2014 by Bob Arun (10 points)
Avoid the special character in user name & buddy name for further use.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...