我们可以在不使用 APNs 的情况下推送通知吗? [英] Can we push notification without using APNs?

查看:32
本文介绍了我们可以在不使用 APNs 的情况下推送通知吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将通知从我的第 3 方服务器直接推送到 Intranet (Wi-Fi) 中的设备?我已经在 APNs 的帮助下实现了向设备推送通知,但是我需要在不使用任何外部服务的情况下实现相同的功能,比如我的服务器和我的设备连接到内联网,我需要检测设备的可用性Intranet 并直接发送通知.任何的想法??提前致谢

Is it possible to push notification from my 3rd party server directly to my device in Intranet(Wi-Fi)? I have achieved to push notification to the device with the help of APNs, but my requirement to achieve the same without using any external service, say my server and my device is connected to an Intranet, i need to detect the availability of the device in the Intranet and send notification directly. Any idea?? Thanks in advance

推荐答案

好吧,如果 - 听起来 - 您正在开发无需通过 App Store 的企业应用程序,那么没有什么可以阻止您使用模仿 APNS 工作方式的 iOS 4 多任务 API.基本上,您的处理方法是通过 UIBackgroundModes Info.plist 键将您的应用程序注册为提供 VoIP 服务——这样系统就会自动启动它并让它在后台运行——然后让应用程序运行打开到您的服务器的持久 IP 连接,您可以通过它向它发送您喜欢的任何通知数据包.从那里,应用当然可以使用 UILocalNotification 来提醒用户注意通知.

Well, if—as it sounds—you’re developing an enterprise app that doesn’t have to go through the App Store, there’s nothing to stop you using the iOS 4 multitasking APIs to mimic the way APNS works. Basically how you’d approach it is to register your app as providing VoIP services via the UIBackgroundModes Info.plist key—so the system launches it automatically and keeps it running in the background—and then have the app open a persistent IP connection to your server, via which you can send it whatever notification packets you like. From there, the app can of course use UILocalNotification to alert the user of the notification.

请注意,如果您确实必须通过 App Store,那么大部分内容都是无效的,除非您的应用实际上要提供 VoIP 服务.但既然你提到使用内部网,我假设你将在内部开发一些东西并且是 企业开发者计划,让你跳过整个App Store的事情,自由使用SDK.

Note that most of this is void if you do have to go through the App Store, unless your app is actually going to provide VoIP services. But since you mention using an intranet, I assume you’ll be developing something in-house and are a member of the enterprise developer program, which allows you to skip the whole App Store thing and use the SDK freely.

这篇关于我们可以在不使用 APNs 的情况下推送通知吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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