zoukankan      html  css  js  c++  java
  • 招财铃:openfire 流程 二,

    1,登陆

    - (BOOL)connectWithJID:(NSString *)JID password:(NSString *)myPassword;

    - (BOOL)anoymousConnection

    - (void)xmppStreamDidConnect:(XMPPStream *)sender

    - (void)xmppStreamDidDisconnect:(XMPPStream *)sender withError:(NSError *)error

    - (void)xmppStreamDidAuthenticate:(XMPPStream *)sender

    - (void)xmppStream:(XMPPStream *)sender didNotAuthenticate:(NSXMLElement *)error

    - (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence *)presence

    相关传递数据格式:

     <iq id=’2’ type=’get’>

               <query xmlns=’jabber:iq:auth’>

                  <username>Juliet</username>

               </query>

           </iq>

     <presence> 

     <status>stepped away…</status> 

                      <show>away</show>

                  </presence>

    2,查找

    - (void)sendSearchRequest:(NSString *)searchField

    - (NSManagedObjectContext *)managedObjectContext_roster

    - (NSArray *)fetchRosters

    相关传递数据格式:

    <iq

    type="get"

    id="1001"

    to="users.jabber.org"

    from="romeo@montague.net/orchard">

    <query xmlns="jabber:iq:search"/>

    </iq>

    3,添加

    - (void)addRoster

     - (void)xmppRoster:(XMPPRoster *)sender didReceiveBuddyRequest:(XMPPPresence *)presence

    - (BOOL)xmppStream:(XMPPStream *)sender didReceiveIQ:(XMPPIQ *)iq

    相关传递数据格式:

    <iq type="set" id="uniquevalue">

    <query xmlns="jabber:iq:roster">

    <item jid="romeo@montague.net"

    name="Romeo"

    subscription="none"

    ask="subscribe">

    <group>friends</group>

    </item>

    </query>

    </iq>

    4,发送信息,收到信息

    - (void)sendMessageTo:(XMPPJID *)targetBareID withMessage:(NSString *)newMessage;

    - (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message

    相关传递数据格式:

     

    <message to="romeo@montague.net/orchard">

    <body>Wherefore art though Romeo?</body>

    </message>

    a,网络请求,

    b,数据返回, 

  • 相关阅读:
    NetCore+AutoMapper多个对象映射到一个Dto对象
    log4net快速上手
    WebService基于soapheader的身份验证
    Canvas入门笔记-实现极简画笔
    .Net修改网站项目调试时的虚拟目录
    Roslyn导致发布网站时报错:编译失败
    .NET通过字典给类赋值
    键盘测试工具
    索引器基类定义
    自定义队列任务执行器
  • 原文地址:https://www.cnblogs.com/guligei/p/3478738.html
Copyright © 2011-2022 走看看