我们正在努力实现XMPP了BOSH我们的产品.该Strophe.jsJavaScript库工作正常,我们上WWW网站的需求.我们请求预绑定,它已经交付,然后我们使用Strophe的'attach'方法来启动我们的会话 - 然后我们就能够更新状态和发送/接收消息.在iOS方面,我们使用的XMPPFramework是包含BOSH传输的robbiehanson ,但是没有附加方法.以下是我试图让它发挥作用的一些悲痛.
我预先绑定,得到我的sid/jid/rid,然后在bosh transport和其他文件中设置内部逻辑,说我们已经连接了.然后,如果我尝试更新状态,包括给定的SID,我发送:
BOSH:SEND [1248340729] = <body xmlns ="http://jabber.org/protocol/httpbind"sid ="568a3ae9"ack ="1248340728"rid ="1248340729"> <presence> </ presence> </ body >
但是没有得到任何答复.那是最后一个.如果我尝试更新状态而不指定SID,我发送:
BOSH:SEND [1064338700] = <body xmlns ="http://jabber.org/protocol/httpbind"ack ="1064338699"rid ="1064338700"> <presence> </ presence> </ body>
并回来:
BOSH:RECD [1342811427] = <body xmlns ="http://jabber.org/protocol/httpbind"xmlns:stream ="http://etherx.jabber.org/streams"authid ="9ef0ccdb"sid ="9ef0ccdb "secure ="true"requests ="2"inactivity ="300"polling ="5"wait ="60"> <stream:features> <mechanisms xmlns ="urn:ietf:params:xml:ns:xmpp-sasl "> <mechanism> PLAIN </ mechanism> </ mechanisms> <compression xmlns ="http://jabber.org/features/compress"> <method> zlib </ method> </ compression> <bind …
在My Xcode项目中,我集成了XMPP框架.它在iOS 5.1模拟器上运行良好.当我尝试在iOS 4.3模拟器上运行该项目时,我收到以下错误:
dyld: lazy symbol binding failed: Symbol not found: _objc_storeStrong
Referenced from: /Users/admin/Library/Application Support/iPhone Simulator/4.3.2/Applications/67451DE6-EFC1-4313-9A29-C2C641F727C6/AppName.app/AppName
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Foundation
dyld: Symbol not found: _objc_storeStrong
Referenced from: /Users/admin/Library/Application Support/iPhone Simulator/4.3.2/Applications/67451DE6-EFC1-4313-9A29-C2C641F727C6/AppName.app/AppName
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Foundation
Run Code Online (Sandbox Code Playgroud)
以下代码行发生错误:xmppStream = [[XMPPStream alloc] init];
进一步调试后,我发现此处发生错误:
- (id)init
{
if ((self = [super init])) //**CRASH WHEN EXECUTING THIS STATEMENT
{
// Common initialization
[self commonInit];
// Initialize socket
asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:xmppQueue];
}
return self;
}
Run Code Online (Sandbox Code Playgroud)
我整合XMPP的项目不是ARC.所以我在所有XMPP文件中添加了-fobjc-arc.XMPP库提供的示例项目在iOS 4.3模拟器上运行良好.任何人都可以帮我解决这个错误吗?
Xcode版本:4.3.3
iOS:iOS 4.3模拟器
我有像Whatsapp这样的iOS聊天应用程序.聊天与XMPP协议运行良好.该应用程序具有其他功能,并且APNS服务运行良好.对于客户端,我正在使用XMPPFramework,以及使用PHP和Tigase的服务器用于XMPP服务器.
问题是:
当XMPP服务器收到他的消息并且他的存在是假的时,如何让服务器向用户发送推送通知?
谢谢!
当新用户向XMPP注册时出现问题.我无法在vCard上设置昵称,但是如果用户的vCard已经存在,那么同一段代码可以正常工作.
dispatch_queue_t queue = dispatch_queue_create("queue", DISPATCH_QUEUE_PRIORITY_DEFAULT);
dispatch_async(queue, ^{
XMPPvCardCoreDataStorage *xmppvCardStorage = [XMPPvCardCoreDataStorage sharedInstance];
XMPPvCardTempModule *xmppvCardTempModule = [[XMPPvCardTempModule alloc] initWithvCardStorage:xmppvCardStorage];
[xmppvCardTempModule activate:[self xmppStream]];
XMPPvCardTemp *myVcardTemp = [xmppvCardTempModule myvCardTemp];
if (myVcardTemp == nil) {
// I am stuck here, unable to create empty VCard for new User
}
else {
[myVcardTemp setNickname:@"iphone"];
[xmppvCardTempModule updateMyvCardTemp:myVcardTemp];
}
});
Run Code Online (Sandbox Code Playgroud)
在xmpp中第一次创建vcard的任何线索?
我正在开发一个iOS应用程序,允许用户登录Facebook,然后使用Facebook Chat API向他的朋友发送消息.
要连接我的Facebook帐户,我正在使用xmppframework(https://github.com/robbiehanson/XMPPFramework).连接已经建立,我可以发送消息给我的朋友.但是,当重新打开对话(Facebook网站,信使)时,该消息将不再可用,并显示一条新消息:"此消息不再可用,因为它被识别为滥用或标记为垃圾邮件".
我不知道发生了什么.我已经尝试检查权限,跟踪身份验证流程,我发现没有任何异常.
有人知道我要做些什么来避免这种情况吗?
我正在使用xmppframework开发聊天应用程序,我已成功完成发送和接收消息,但是
1)如果我正在与用户A聊天并且用户B向我发送消息,我该如何识别用户B发送给我的消息.(我已经在核心数据中维护消息,因此将保存消息)2)如何识别接收到的消息是读取还是未读取
注意:用于保存消息
xmppMessageArchivingStorage = [XMPPMessageArchivingCoreDataStorage sharedInstance];
xmppMessageArchivingModule = [[XMPPMessageArchiving alloc] initWithMessageArchivingStorage:xmppMessageArchivingStorage];
Run Code Online (Sandbox Code Playgroud)
谢谢
我想在iOS中使用xmpp框架匿名连接到openfire服务器.我可以通过提供JID和PW连接到开火.但是,当我尝试匿名连接时,它说"服务器不支持匿名身份验证".
我在xib文件中使用了一个按钮.当点击下面的代码时执行:
- (IBAction)login:(id)sender {
[[self appDelegate]connect];
NSError *authenticationError = nil;
[self.xmppStream authenticateAnonymously:&authenticationError];
}
Run Code Online (Sandbox Code Playgroud)
以下是connect方法的代码:
- (BOOL)connect {
[self setupStream];
xmppStream.hostName = @"abc.xyz.com";
//xmppStream.hostName = @"Virtuals-MacBook-Pro.local ";
NSString *jabberID = [[NSUserDefaults standardUserDefaults] stringForKey:@"userID"];
NSString *myPassword = [[NSUserDefaults standardUserDefaults] stringForKey:@"userPassword"];
if (![xmppStream isDisconnected]) {
return YES;
}
if (jabberID == nil || myPassword == nil) {
return NO;
}
[xmppStream setMyJID:[XMPPJID jidWithString:jabberID]];
password = myPassword;
NSError *error = nil;
if (![xmppStream connectWithTimeout:XMPPStreamTimeoutNone error:&error])
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error"
message:[NSString …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过SSL将我的用户从我的iOS XMPP聊天客户端连接到Openfire服务器.
在我的iOS客户端中:
- (void)setupStream
{
...
// BOOL values for security settings
customCertEvaluation = NO;
allowSelfSignedCertificates = YES;
allowSSLHostNameMismatch = NO;
}
Run Code Online (Sandbox Code Playgroud)
在我的Openfire服务器的安全设置 > 客户端连接安全性中,我设置了:
Required - Clients can only connect to the server using secured connections.
因此,将调用以下委托方法:
- (void)xmppStream:(XMPPStream *)sender willSecureWithSettings:(NSMutableDictionary *)settings
{
NSString *expectedCertName = [xmppStream.myJID domain];
if (customCertEvaluation)
[settings setObject:@(YES) forKey:GCDAsyncSocketManuallyEvaluateTrust];
if (allowSelfSignedCertificates)
[settings setObject:[NSNumber numberWithBool:YES] forKey:(NSString *)kCFStreamSSLAllowsAnyRoot];
if (allowSSLHostNameMismatch)
[settings setObject:[NSNull null] forKey:(NSString *)kCFStreamSSLPeerName];
else
if (expectedCertName) …Run Code Online (Sandbox Code Playgroud) 我们将ejabberd 17.01用于iOS和Android应用程序.
我们需要创建一个持久的房间,用户可以在房间没有连接/加入时接收消息.
我们认为ejabberd有解决方案.
如何在iOS中的XMPPFramework中配置并在Android SMACK库中进行配置?
如何在我的名册中添加多个用户?现在我可以一次添加一个用户.但现在我必须与XMPP同步设备联系.使用后端API我可以过滤掉在应用程序中注册的联系人.现在将它们逐一添加到名册中需要花费太多时间.
那么有没有更快捷的方式将多个联系人添加到名册中?
我已经经历了很多像这样的问题,但是他们没有帮助.
并且过滤设备与后端API联系是一种很好的方法,还是我应该做其他事情?