【问题标题】:Facebook message sending failed using xmpp in xcode在 xcode 中使用 xmpp 发送 Facebook 消息失败
【发布时间】:2013-09-19 10:59:00
【问题描述】:

我正在使用此代码发送消息,但我的消息未送达。 而我收到从 facebook 发送的消息。 请帮助我,因为我不知道我做错了什么。

if([textMessage length] > 0){
    NSXMLElement *body = [NSXMLElement elementWithName:@"body"];
    [body setStringValue:textMessage];
    NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
    [message addAttributeWithName:@"xmlns" stringValue:@"http://www.facebook.com/xmpp/messages"];
    [message addAttributeWithName:@"to" stringValue:[NSString stringWithFormat:@"-%@@chat.facebook.com",friendID]];
    [message addChild:body];
    [self.xmppStream sendElement:message];
}

【问题讨论】:

  • 谢谢,问题已解决

标签: ios objective-c facebook xmpp xmppframework


【解决方案1】:

以防万一其他人遇到同样的问题,“xmlns”属性必须从 Facebook url 更改为“jabber:client”才能工作。

【讨论】:

    猜你喜欢
    • 2013-10-28
    • 1970-01-01
    • 1970-01-01
    • 2013-03-26
    • 1970-01-01
    • 2013-02-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多