IOS XMPP never receives any friends / registry requests

Customization

I am sending a friend / list request using this code:

[[[XMPPController sharedObject] roster] addUser:[XMPPJID jidWithString:[user stringByAppendingString:@"@server.com"]] withNickname:nil]; 

and I can confirm that a request is being sent from the ejabberd Web Admin control panel. In addition, the request is returned in the thread delegation method:

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

as a confirmation.

Here I read a few questions about what request should be processed in the delegate method:

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

as an alternative

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

Problem

The problem is that none of these methods are called after sending the request.

Checked for

  • iPhone 5 (iOS 9.3.1)
  • iPhone Simulator (iOS 9.3)

Sending from any device does not succeed.

Notes

I can confirm that a friend’s request has been sent because it appears in the ejabberd admin panel. In addition, if a user is added from the admin panel, nothing happens on the client side (the one that should receive the request, that is.).

+5
source share
1 answer

Method - (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence *)presence or - (void)xmppRoster:(XMPPRoster *)sender didReceivePresenceSubscriptionRequest:(XMPPPresence *)presence not called because you are not sending XMPPPresence .

+2
source

Source: https://habr.com/ru/post/1247306/


All Articles