带实时聊天模块的 iPhone 后台操作/守护进程。让应用程序保持活力?
我正在为 iPhone 构建一个实时聊天应用程序,为此,有必要确保操作员在线并保持数据流畅通。
经过多次搜索,对于类似的行为似乎只有两种选择; UILocalNotification,仅当我有一些预定的信息通知要发送时才有效 推送通知,用于将数据推送到手机
推送通知的问题似乎是我无法确保用户可用,或者在用户不重新打开应用程序的情况下以任何方式与应用程序交谈。这样,我似乎不可能知道用户是否在线,更新应用程序中的数据而无需用户手动打开它,等等。
所以,我要求的是,是否可以以任何方式保持应用程序处于活动状态在后台确保操作员在线并通知传入的聊天会话?
非常感谢你们的帮助!
I am building a live chat app for the iPhone, and for this it is necessary to ensure that the operator is online and to keep the flow of data going.
After much search it seams to be only two options for similar kind of behavior;
UILocalNotification, only works if I have some scheduled information notice to be sent
Push Notification, for pushing data to the phone
The problem with push notification seams to be that I cannot ensure that the user is available, or in any way talk with the app without the user re-opening it. This way it seams impossible for me to know if the user is online, to update data in the app without the user having to manually open it, etc.
So, what I ask for, is it in any way possible to keep the app active in the background thus ensuring the operator is online and notify of incoming chat sessions?
Thanks a lot for your help guys!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是答案是否定的。我认为您指的是文本聊天而不是 VoIP(可以在后台运行)?您最好的选择是推送通知,因为当应用程序位于后台时,您将无法监控应用程序本身的任何内容。
Unfortunately the answer is no. I take it you mean text chat and not VoIP (which CAN run in the background)? Your best bet would be Push Notifications, as you would not be able to monitor anything from the app itself when it is in the background.