iOS: XMPPRoster Gets the list of Invited buddies as well - ios

I am building an iOS chat application using the XMPPframework. I have been able to register, send invites, accept invitation and chat. However when I try to populate my buddy list using the Roster, I get the names of all the buddies whom I have already added as well as whom I have sent Friend request. I am not able to differentiate between them. I have tried to dig into the XMPPRosterMemoryStorage class but all the methods are returning the same list (sorted/unsorted).
How to show an invited buddy as pending if he has not accepted the invitation yet.
Please help.
Thanks.

Answering my question. Looks like i didn't dig deep enough in XMPPRosterMemoryStorage class. All the jid's along with other details like subscription & ask attributes are received in Roster. However the methods sorted/unsorted were returning only the jid's of all the users. I went back and customized the XMPPRosterMemoryStorage class to return only jid's which have been accepted by both users.

Related

How to add friends via XMPPFramework

I'm working on an IM application using XMPPFramework. When I want to add a friend, I send a presence stanza, and the friend would be automatically added to XMPPRoster before&whether the other side accepts or rejects. I don't know why. Does any one know? Thanks in advance.
The stanza is like this:
<presence to='juliet#example.com' type='subscribe'/>
After reading the source code and other material. I found that the roster here does not exactly mean what it is in Wechat (a Chinese IM app) or MSN. So those who in your roster does not need to be your friends but the ones who you want to subscribe.

How whatsapp get updated contacts from addressbook faster in iOS?

My findings
I am designing a logic to sync contact with my Backend. I gone through some apps that doing same thing in IOS. I will take the example of WhatsApp, I found that When I update any contact in Native Addressbook, it reflect that change into Whatsapp withing a fraction.
My Concern
I just want to know that how it is syncing in a very faster way. Even a new contact gets synced with its Remote server and get displayed on contact, and with the ability to initiate Whatsapp chat if that number is registered one.
Summary of Queries
So, in nutshell my queries are,
How Whatsapp is syncing the contact?
How whatsapp is getting just updated contact list from Native Addressbook (if it's doing so) ?
How whatsapp is just getting just new Contact added in addressbook, is there anything that manages like timestamp or anything else?
I know the following things are there like,
ABAddressBookGetPersonCount
ABAddressBookGetPersonWithRecordID
ABAddressBookCopyArrayOfAllPeople
Using the ABAddressBookGetPersonCount i can know if any new contacts are there but still how i will be able to know its Record ID without iterating each contact using ABAddressBookCopyArrayOfAllPeople
So i am just asking for the way to get just updated list.
The way to do this is by registering an external change callback. This way, your app will be notified of any changes to the address book as soon as they happen.

How to share data between devices?

Hello i want to share lists in my app between different devices. I want that person a can invite persob b to his list. Now person a and person b can read and modify the list.
The list is only visible for the invited pesons (person a and b). But every person who has donwloaded the app can create his own list and
invite persons.
But how can i implement the invitation function that person a can invite person b?
Do you have an idea how to implement the invitation and share functionallity or does anybody have a good tutorial?
Any suggestions are very welcome.
This can be done. With Parse. Read through the documentation on Parse's website. Once you tinker with a few things and see how it all works you'll come up with a clever solution. Use google as well if you're ever stuck on anything. It's all trial and error.
Parse iOS Guide
https://parse.com/docs/ios_guide#top/iOS

Avatar for anonymous users in multi-user chat in XMPP

I am writing an iOS app that features anonymous multi-user chat. All the users logged in using
[self xmppStream] authenticateAnonymously:&error]
So they all have random bare JID. What I am trying to achieve here is implement anonymous multi-user chat with avatar, I've done some research in the documentation but is still unclear on how I could do this.
Some of the questions that I am still not understanding yet:
Can anonymous user have a vcard? If this is possible, will the server automatically delete the vcard for the anonymous user once he disconnected? (I am running OpenFire)
What is the most efficient way to implement this avatar enabled anonymous MUC? What I am thinking right now is to get a list of occupants (not sure how to do this) when a user enters the room, and when a user speaks, download the user avatar if it is not stored or it has been changed (don't know how to do this as well)
If you could provide some sample codes to get me started, I would really appreciate it.
Thank you for your time!
XMPPvCardTempModule with XMPPvCardTempCoreDataStorage and XMPPvCardAvatarCoreDataStorage will do the job for you, check iPhoneXMPP project from XMPPFramework for example usage. The only difference in anonymous usage is that you need to publish your own vCard on every login.

Posting message to multiple walls does not work

I'm developing some application for the Facebook and iPhone.
User of our application would like to send to his friends notifications (only friends not other people), such as normal message. But the problem is that it’s the same message such as: "I would like to invite you to a party on Saturday". Posting one message works, but I encountered a problem when I post more messages at once. I do believe that this have to be some anti-spam filter or some other mechanism that is prohibiting posting messages in batch to walls of friends. I’m using Graph API for posting. Can somebody explain me or lead to some link how exactly this works and more importantly how to avoid this in my application…? Is it possible by paying some fee/credits to Facebook to allow my users to post messages to friends as they would like or this is simply not possible?
Just one important note: this is not a spam software and my user does not send wall messages (or notifications) to other people, only his selected friends and for sure the user is aware about this and the message is sent after user confirmation. Maybe I miss something, some application privilege?
Thank you in advance.
Marcin

Resources