XMPP Personal Information Display

Source: Internet
Author: User
Tags vcard

At this stage of the communication service. Various standards are present, and therefore there is an inability to achieve interconnection, whereas the XMPP (extensible Message and Presence Protocol) protocol appears. It realizes the intercommunication of the whole timely Communication service agreement. With this agreement, the use of any organization or individual to provide even communications services can be accessible to other users of the timely communication services. Google Talk, for example, launched in 2005, is an XMPP protocol-based instant messaging software. Let's talk about how to simply use XMPP's friends and personal electronic Business cards

1, in the XMPPFramework.h will need to use the header file open

2. Create an Electronic Business Card page in storyboard

3. Define data storage and vcard model properties and initialize
Electronic Business Card @property (strong,nonatomic) xmppvcardtempmodule * vcardmodule;//vcard storage @property (strong,nonatomic) Xmppvcardcoredatastorage *vcardstorage;   Initialize card storage        self.vcardstorage=[xmppvcardcoredatastorage sharedinstance];        Initialize the nickname brochure storage        Self.rosterstorage=[[xmpprostercoredatastorage alloc] init];   Activating the current Electronic Business card        [Self.vcardmodule Activate:self.stream];
4, create the corresponding class, and with the Electronic Card Storyboard Association. Connecting the outputs

5. Get the current people e-card
Get vcard card information i.e. personal information    appdelegate * delegate=[uiapplication sharedapplication].delegate;        Xmppvcardtemp *vcard = [Delegate.vcardmodule myvcardtemp];    Assuming that the E-card information does not exist need to be set again    if (vcard==nil) {        vcard=[xmppvcardtemp vcardtemp];        Vcard.nickname=[[nsuserdefaults Standarduserdefaults] objectforkey:@ "UserName"];    }        if (vcard.jid==nil) {        Xmppjid * Jid=[xmppjid jidwithstring:[[nsuserdefaults standarduserdefaults] objectForKey:@ " UserName "];        Vcard.jid=jid;    }     Update the changed data [Delegate.vcardmodule Updatemyvcardtemp:vcard];
6. Display the information of the electronic card to the UI interface
    Display the information of the vcard to the UI        Self.jrimage.image=[uiimage ImageWithData:vcard.photo];    Self.name.text=vcard.nickname;    Self.jid.text=vcard.jid.full;        Self.email.text=vcard.mailer;    Self.company.text=vcard.orgname;    Self.depart.text=[vcard.orgunits Firstobject];    Self.post.text=vcard.title;    Self.tel.text=vcard.note;

For example, the following:

6, change the electronic card. Involves changes to personal information. Here we need to do the UI again

Click on the change call method to

Update the changed data [Delegate.vcardmodule Updatemyvcardtemp:vcard];

A small partner who wants to learn a lot about other content. You can click to view the source code and perform the test yourself.

Inquiries or technical exchanges. Please add the official QQ Group: (452379712)

Jerry Education
Source:http://blog.csdn.net/jerehedu/
The copyright belongs to Yantai Jerry Education Technology Co., Ltd. and CSDN co-owned, welcome reprint, but without the author's permission must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.

XMPP Personal Information Display

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.