iOS背景和XMPP框架 [英] iOS Backgrounding & XMPPFramework

查看:58
本文介绍了iOS背景和XMPP框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我已经创建了一个简单的XMPP应用程序,但是除非该应用程序是指定的类别之一,否则我似乎无法进行后台处理.

So I've created a simple XMPP app, but it appears I can't have background processing unless the app is one of the designated categories listed here.

我只是想保持套接字打开状态,并在应用程序不在前台时显示收到消息的通知.

I just want to keep the socket open and display a notification on message received if the app isn't in the foreground.

我发现要找到有关iOS背景的良好信息有些困难,看来很多应用程序都设法做到这一点,但是文档似乎要严格得多.

I've found it a little difficult to find out good information on iOS backgrounding, it appears a lot of apps out there manage to do it some how, but the documentation seems a lot more restrictive.

是否可以在后台长时间运行这样的聊天客户端?类似于Android服务的生命周期吗?

Is it possible to run a chat client like this in the background for extended periods of time? Something similar to Androids Service lifecycle?

推荐答案

当应用在后台运行时,您(客户端)关闭与xmpp服务器的连接. 当您的应用回到前台时,您将重新打开连接. 如果您的服务器需要向客户端发送消息,则它必须使用推送通知. 当客户端收到通知时,CAN(取决于用户操作)可以回到前台.

When your app goes in background you (the client) close the connection with the xmpp server. When your app comes back into foreground you reopen the connection. If your server need to send messages to your client, it must use push notifications. When the client receives the notification CAN (it depends on the user action) can back to foreground.

这篇关于iOS背景和XMPP框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆