在XMPP中以后台模式工作 [英] Working In Background Mode in XMPP
问题描述
我正在研究XMPP.我想在后台模式下收到通知.而且我也实现了这些东西,
I am Working On XMPP. I want to get notification in background mode. And I implement this things also ,
- (void)xmppStream:(XMPPStream *)sender socketWillConnect:(GCDAsyncSocket *)socket
{
// Tell the socket to stay around if the app goes to the background (only works on apps with the VoIP background flag set)
[socket performBlock:^{
[socket enableBackgroundingOnSocket];
}];
}
在我的代码中,我在应用程序plist文件的后台模式下设置了VOIP标志.在这种模式下,我的应用程序可以完全在后台运行.但是苹果拒绝那样.
in my code i set VOIP flag in background modes of app plist file. In this mode my app can run in the background completely. But apple reject that way.
所以.我认为另一种方式是APNS(推送通知),但是在我的应用中,大量的聊天用户随后如何使用推送通知来处理消息?
So. i think other way is APNS(Push Notification) but In my app huge chatting users then how can handle messges using Push Notification ?
还有另外一件事,我可以设置无声音频文件在后台模式下播放并设置后台模式工作吗?这样从苹果方面有什么问题或地方问题吗?
And one more thing can i set silent audio file play in background mode and set background mode working ? in this way any problem or regection problem from apple side ?
因此,请给我一些有关此问题的正确想法和建议.
So, Give Me some proper idea and suggestion For this Question.
在此先感谢x.
推荐答案
如何使用推送通知"处理消息?
您需要检查用户是否已连接到XMPP服务器.如果用户已连接到XMPP,请继续通过XMPP消息传递,如果用户未连接到XMPP,请发送推送通知,以帮助用户联机显示并接收消息.
You need to check if user is connected to XMPP server or not. If user is connected to XMPP go ahead via XMPP messaging , if user is not connected to XMPP , send push notification that will help user to appear online and receive messages.
还有另外一件事,我可以设置无声音频文件在后台模式下播放并设置后台模式工作吗?这样从苹果方面有任何问题或拒绝问题吗?
是的,苹果将拒绝应用程序(旨在欺骗苹果)
Yes apple will reject app (Intended to cheat Apple )
这篇关于在XMPP中以后台模式工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!