0
Xmpp.i를 사용하여 응용 프로그램을 시도하고 있는데 로그인 페이지 (emailid, 비밀번호, 호스트 이름 (talk.google.com))를 만들었습니다. 내가 작성한 첫 페이지입니다. 로그인 버튼을 누르면 (성공하면 다음보기로 들어간다) emailid (우리는 메시지를 보낼 사람)와 메시지 (사람)를위한 두 개의 텍스트보기로 구성된다는 점에서 다른보기를 얻을 것이다. 메시지 보내기)를 클릭하고 보내기 단추를 클릭하여 메시지를 보내야합니다. 나를위한 주된 문제는 성공적으로 기록 된 것입니다. 그러나 그 메일 ID로 메시지를 보내지 마십시오. 어느 누구도이 작업을 수행하는 데 도움이되지 않습니다. 코드는 다음과 같습니다아이폰에서 Xmpp를 사용하여 특정 이메일 ID로 메시지를 보내는 방법
감사합니다. 바람둥이
도메인에있는 JID에 메시지를 보내려면 여기를-(IBAction)SendButtonPressed:(id)sender
{
NSLog(@"send button clicked");
[self.msgTextView resignFirstResponder];
//NSString *user;
//user=emialTextField.text;
//[self.emialTextField resignFirstResponder];
//XMPPUserCoreDataStorage *user = [(XMPPUserCoreDataStorage *) emialTextField.text];
XMPPJID *jid=[XMPPJID jidWithString:emialTextField.text];
[[self xmppStream] setMyJID:jid];
XMPPApplicationAppDelegate *appDelegate=(XMPPApplicationAppDelegate *)[[UIApplication sharedApplication] delegate];
xmppStream=[appDelegate xmppStream];
//self.user.displayName;
NSXMLElement *body = [NSXMLElement elementWithName:@"body"];
[body setStringValue:self.msgTextView.text];
NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
[message addAttributeWithName:@"type" stringValue:@"chat"];
//[message addAttributeWithName:@"to" stringValue:[user jid]];
[message addAttributeWithName:@"to" stringValue:self.emialTextField.text];
[message addChild:body];
[xmppStream sendElement:message];
}