小编Tas*_*asZ的帖子

如何使用xmpp openfire发送输入通知

我正在开发聊天应用程序我想发送收件人"正在打字"当我输入消息时,任何人都知道如何使用xmpp框架和开火作为服务器.

下面是我的代码

-(void)sendChatStateNotification: (NSString *)strState
{
     NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
     NSXMLElement *chatStatus=[NSXMLElement elementWithName:strState xmlns:xmlns_chatstates];
    [message addAttributeWithName:@"type" stringValue:@"chat"];
    [message addAttributeWithName:@"to" stringValue:chatWithUser];
    [message addChild:chatStatus];
}

-(void)textViewDidChange:(UITextView *)textView
{
    [self sendChatStateNotification:@"composing"];
}
Run Code Online (Sandbox Code Playgroud)

我仍然没有收到通知

xmpp openfire objective-c ios

3
推荐指数
1
解决办法
1767
查看次数

标签 统计

ios ×1

objective-c ×1

openfire ×1

xmpp ×1