ios - XMPPFramework - Auto Accept of Presence Subscription Requests -


I think the title is describing enough, but this is the story:

I > XMPPFramework for iOS, and I want to set up my client to automatically receive any subscription request that receives it. That is why other customers can see the presence status of this customer, when they request it.

According to developer annotations, in the XMPPRoster.h file, this method is said to be received during the membership request:

  / ** * When a membership membership request is received * That is, the other user has added you to your roster * and is requesting permission to receive the broadcast you send. * * The complete appearance packet has been provided for proper expansion. * You can use [presence] to receive the user's JID who sent the request. * * Accept the acceptance of the acceptance subscription from the vacancy: and reject the subscription amount: * Can be used to answer the request ** / - (zero) XMPPOaster: (XMPPROOSTER *) The sender did not accept the threshold for receipt of membership request: (XMPPENCENTS * ) Presence;  

but it is not implemented in XMPPRoster.m . Therefore I implemented it as:

  - (zero) xmppRoster: (XMPPROOSTER *) The sender did the SEPPEPENCE membership request: (XMPPSANCE *) presence {[from self-acceptance membership membership Request: [Attendance] and AdToroster: Yes]; }  

Since I'm new to XMPPFramamework, I do not know if I did something wrong, but I still can not get the presence of this client in other customers.

I can see similar topics as well but the solution is not related too!

Any suggestion is really appreciated. Thank you.

You did it wrong. You do not need to implement anything in XMPPRoster.m or other library files. This function

  - (zero) xmppRoster: (XMPPROOSTER *) The sender did the suspense membership request: (XMPPence *) Presence;  

A callback is removed, when your XMPP customer receives attendance membership request. If you want to execute some code while extracting this codeback, you will need to implement a protocol named XMPPRosterDelegate in Java and C # or there is an intuitive feature in C ++ There should be a class that is derived from this XMPPRosterDelegate and finally executes this function (and other functions if you wish).

Implement your protocol function implementation in the same way if you want to automatically approve all requests:

  - (zero) xmppRoster: (xmpproaster *) sender Sweeppepsens membership request: (XMPPsense *) Presence {[request from sender acceptance subscription membership: [Attendance] and ADToroster: Yes]; }  

In addition to this, the roster object came to know who is the representative (one object which implements XMPPRosterDelegate ), if you send a message to someone Two things you want to know: The goal and the selector selector have been specified in the protocol. The target is a representative property. You must set the roster representative during your initialization. I added the line to my code

  [xmppRoster addDelegate: self delegateQueue: dispatch_get_main_queue () ];  

Before the line

  [xmppRoster active: xmppStream];  

Applies manually XMPProosterDelegate and this piece of code specifically is

  - (Zero) XMPPOaster: (XMPPROOSTER *) The sender did the SEPPEPENCE membership membership request: (XMPPence *) Presence {[Sender acceptance subscription membership request: [Attendance] and adtioroster: Yes]; }  

Sorry for the good post and the long post.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -