我正在开发聊天应用程序我想发送收件人"正在打字"当我输入消息时,任何人都知道如何使用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)
我仍然没有收到通知