gpt4 book ai didi

ios - XMPPFramework - 存在不变

转载 作者:行者123 更新时间:2023-11-28 23:05:35 26 4
gpt4 key购买 nike

我正在尝试将用户状态设置为离开(或目前的任何状态)。我正在使用以下代码,但它似乎没有做任何事情。

XMPPPresence *presence = [XMPPPresence presence];
NSXMLElement *show = [NSXMLElement elementWithName:@"show" stringValue:@"away"];

NSXMLElement *status = [NSXMLElement elementWithName:@"status" stringValue:@"away"];
[presence addChild:show];
[presence addChild:status];
[[self xmppStream] sendElement:presence];

我已经使用 iChat 来确保我的 Ejabberd 服务器上的所有状态订阅都正确且有效。这快把我逼疯了,我是不是错过了什么?

最佳答案

我想通了,因为我错过了这个,所以应用程序没有发送存在:

- (MMApplication *)appDelegate {
return (MMApplication *)[[UIApplication sharedApplication] delegate];
}
- (XMPPStream *)xmppStream {
return [[self appDelegate] xmppStream];
}

现在完美运行

关于ios - XMPPFramework - 存在不变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9340766/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com