I am developing an xmpp client for iphone. i am able to send and receive message. I want to accept the buddy request automatically without prompting to user. In which function will i receive request. Please give me any hints.
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Alright, I have got a perfect answer for you!
Here is the code:
I have provided you with the complete code of DidReceivePresence method for your better understanding.
Now let me explain you with the code. If you notice in the else if condition I’m comparing the value (element) which we are receiving. So when I get the string as Subscribe (when the user sends the friend request), you just need to add that particular user in your tableview buddy list.
You can get the username from “presenceFromUser”.
If you need anymore understanding then email me on blueobaid@gmail.com because I don’t get alerts when you response to my answer, though I’ll come back and reply here itself so that it might help others too! and I’m going to put a tutorial soon on http://Czartechnogeeks.com/iSolutions
I’m glad that I’m able to share something valuable to the user with stackoverflow after it helped me much.