XMPP Personal Information Display

Source: Internet
Author: User
Tags vcard

At this stage of communication services, all kinds of standards have, so there will be unable to achieve interconnection, and XMPP (extensible Message and Presence Protocol) protocol, the realization of the entire timely Communication Service protocol interoperability. With this agreement, the use of any one organization or individual, even if the communication services, can be accessible to other users of the timely communication services to communicate. 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 them
Electronic Business Card @property (strong,nonatomic) xmppvcardtempmodule * vcardmodule;//vcard storage @property (strong,nonatomic) Xmppvcardcoredatastorage *vcardstorage;   Initialize card storage        self.vcardstorage=[xmppvcardcoredatastorage sharedinstance];        Initialize roster 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, connect the export

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];    If the E-card information does not exist, you need to reset 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 modified 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;

As follows:

6, modify the electronic card, related to the modification of personal information, here we need to re-do the UI

Click Modify Call method to

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

To learn more about the small partners, you can click to view the source code , run the test yourself.

Inquiries or technical exchanges, please join the official QQ Group: (452379712)

Jerry Education
Source:http://blog.csdn.net/jerehedu/
This article is the copyright of Yantai Jerry Education Technology Co., Ltd. and CSDN Common, welcome reprint, but without the author's consent must retain this paragraph statement, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

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.