作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发一款聊天应用。
- (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message{}
当App is Background
时,此方法有效并在模拟器中运行时捕获购买断点但在 Real Device App 中的应用程序中运行时
background mode . its not working in background mode
最佳答案
添加以下代码
UIBackgroundTaskIdentifier bgTask = 0;
UIApplication *app = [UIApplication sharedApplication];
bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
[app endBackgroundTask:bgTask];
}];
在你的
- (void)applicationDidEnterBackground:(UIApplication *)application
然后这个方法
- (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message{}
也将在后台工作。
有关 BackgroundTask 的更多信息,请访问 Documentation
关于ios - didReceiveMessage :(XMPPMessage *)message Not Running Actual Device,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39020100/
我收到所有用户发送给我的所有消息。 当我得到结果时,它是 XMPPMessage 类型,我不知道如何从中提取正文 This problem is related to get archived mes
我正在开发一款聊天应用。 - (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message{} 当App
我正在开发一个聊天应用程序并使用 xmppframework 。现在需要将消息存储在持久存储中。谁能告诉我如何在 IOS 中存储和检索来自 CoreData 的消息。 最佳答案 由于您使用的是 git
我正在我的 iOS 应用程序中实现 XMPP。我知道 XMPPMessage+XEP_0085 类别有一些简单的方法,例如 addActiveChatState、addCompositionChatS
我是一名优秀的程序员,十分优秀!