File transfer using XMPP (Extension XEP-0065)

孤街浪徒 提交于 2019-12-04 21:17:03

[TURNSocket setProxyCandidates:[NSArray arrayWithObjects:Receiverjid, nil]]; In this replace "Receiverjid" with hostname, eg:sa.com,

iducool ,you can find full jid with resource in following method of AppDelegate.

- (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence *)presence
{
    DDLogVerbose(@"%@: %@ - %@", THIS_FILE, THIS_METHOD, [presence fromStr]);

  //  NSString *presenceType = [presence type]; // online/offline
    NSString *myUsername = [[sender myJID] user];
    NSString *presenceFromUser = [[presence from] user];

    NSLog(@" Printing full jid of user %@",[[sender myJID] full]);
    NSLog(@"Printing full jid of user %@",[[sender myJID] resource]);
    NSLog(@"From user %@",[[presence from] full]);
    senderFullID=[[presence from] full];
}
Iducool

Don't know what to set in setProxyCandidates, but I am setting my Server name.

<error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error>

Solution: Pass full jabber id:username@domain/resource. In my case I have changed 'user2@testXyz/spark; to 'user2@testXyz/Spark 2.6.3'

I don't know how to find these resource parameters. I have checked XMPPJID class's resource parameter but it is nil. I found these parameters by seeing some console logs. If anybody know how to find this from any xmpp class then please let me know.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!