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,数据返回, 

  • 相关阅读:
    [LeetCode] Sort Colors
    [LeetCode] Trapping Rain Water
    [LeetCode] Sudoku Solver
    [LeetCode] Valid Sudoku
    [LeetCode] Candy
    [LeetCode] Permutation Sequence
    [名词解释]Constant Amortized Time
    回溯法 子集树和排序树
    HDU 4859 海岸线 最小割
    敏捷开发一千零一问:怎样处理重要但不明白的任务?
  • 原文地址:https://www.cnblogs.com/guligei/p/3478738.html
Copyright © 2011-2022 走看看