Prabhjot Singh Gogana
Prabhjot Singh Gogana

Reputation: 1408

Send info regarding user via XMPP in iOS

I have implemented the chat and everything is working good. I follow that link http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-server-setup/ tutorial to implement chat app. Now i want to send info regarding user like photo,birthday,nickname etc. So i just want to create that info and send to other user.

I also want to send image(Data) to another user.

Upvotes: 2

Views: 2063

Answers (2)

user989005
user989005

Reputation: 1

first setup user profire in spark and then use [XMPPvCardTempModule myvCardTemp]

Upvotes: 0

NoilPaw
NoilPaw

Reputation: 714

To set an avatar and other user-information you should have a look at the vcard extension XEP-0153 (specification and implementation).

You will find an example implementation for the vCard within the XMPPFramework iphone demo. You would use the following calls to update and fetch vCards:

- (XMPPvCardTemp *)fetchvCardTempForJID:(XMPPJID *)jid;
- (XMPPvCardTemp *)fetchvCardTempForJID:(XMPPJID *)jid useCache:(BOOL)useCache;
- (void)updateMyvCardTemp:(XMPPvCardTemp *)vCardTemp;

To send binary data, you have some options. The XMPPFramework implements XEP-0065. There are other methods to send data like:

Which you could probably implement as extensions and integrate them into the XMPPFramework.

In will integrate sending binary data like images and videos myself soon. So please leave a comment about your implementation.

Upvotes: 3

Related Questions