来自服务器的iPhone实时通知,而无需使用Apple推送通知 [英] iPhone real time notification from a server, without using Apple push notification

查看:70
本文介绍了来自服务器的iPhone实时通知,而无需使用Apple推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种从iPhone App中的服务器获取实时通知的方法.我不想使用Apple Push Notification,因为我有很多通知.我的Web服务是用PHP编码的,我还没有想出实现此功能的简便方法.知道该怎么办吗?

I'm looking for a way to get real time notification from a server in an iPhone App. I don't want to use Apple Push Notification as I have many notifications. My web service is coded in PHP, and I haven't figured out an easy way to implement this functionnality. Any idea what should I do?

非常感谢您的帮助!

我正在寻找一种仅在启动应用程序时获得通知的方法(否则,唯一的选择不是Apple Push.).

EDIT : I'm looking for a way to get notification only when the app is launched (otherwise, the only option IS Apple Push not.).

推荐答案

如果应用程序正在运行,则可以打开从应用程序到服务器的http连接,并使服务器保持打开状态,并在需要时通过它推送数据.基本上,这就是 COMET 的工作方式.

If the app is running you can open an http connection from the app to the server and have the server hold it open, pushing data through it when you want. This is basically how COMET works.

这仅在您的应用程序运行时有效.如果即使用户已关闭应用程序也需要通知,那么Apple Push Notifications是您唯一的选择.

This will only work while your app is running. If you need the notification to happen even if the user has closed the app then Apple Push Notifications are your only option.

这篇关于来自服务器的iPhone实时通知,而无需使用Apple推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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