3
我正在開發聊天應用程序我想發送收件人「正在輸入」當我輸入消息時,是否有任何人有想法如何使用xmpp框架來做到這一點,並打開火災作爲服務器。如何使用xmpp openfire發送打字通知
下面是我的代碼
-(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"];
}
我仍然沒有得到通知
看看這個擴展類別 - XMPPMessage + XEP_0085 – akc
但更大的挑戰是如何從您設置的標籤 –
中刪除「打字...」,我們可以檢查此狀態? – jaskiratjd