Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS XMPP never receives any friend / roster requests

Tags:

ios

xmpp

Setup

I'm sending a friend / roster request using this code:

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

and I can confirm that in the ejabberd Web Admin control panel, the request is sent. Also, the request is returned in the stream delegate method:

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

as confirmation.

I've read across multiple questions here that the request should be handled in the delegate method:

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

alternatively

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

The Issue

The issue is that neither of these methods get called once a request is send.

Tested on

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

Sending from either devices yields no success.

Notes

I can confirm that the friend request is send, because it is visible in the ejabberd admin panel. Additionally, if a user is added from the admin panel, nothing happens on the client side (The one that should receive the request, that is.).

like image 440
JomanJi Avatar asked Oct 31 '22 05:10

JomanJi


1 Answers

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

like image 57
Loegic Avatar answered Nov 09 '22 04:11

Loegic