我们可以推送通知而不使用APN吗?(Can we push notification without using APNs?)

系统教程 行业动态 更新时间:2024-06-14 16:57:18
我们可以推送通知而不使用APN吗?(Can we push notification without using APNs?)

在Intranet(Wi-Fi)中,是否可以将我的第三方服务器的通知直接推送到我的设备? 我已经实现了在APN的帮助下将通知推送到设备,但是我的要求是在不使用任何外部服务的情况下实现相同的目标,例如我的服务器和设备连接到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的企业应用程序,就没有什么能阻止你使用iOS 4多任务API来模仿APNS的工作方式。 基本上你会怎么做,就是将你的应用程序注册为通过UIBackgroundModes Info.plist键提供VoIP服务 - 所以系统会自动启动并保持它在后台运行 - 然后让应用程序打开一个持久IP连接到你的服务器,通过它你可以发送任何你喜欢的通知包。 从那里,应用程序当然可以使用UILocalNotification来通知用户。

请注意,如果您不得不通过App Store,那么大多数情况都是无效的,除非您的应用程序实际上将提供VoIP服务。 但是由于您提到使用Intranet,我假设您将在内部开发一些东西,并且是企业开发人员计划的成员,这使您可以跳过整个App Store并免费使用SDK。

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.

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.

更多推荐

本文发布于:2023-04-12 20:16:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/4f3f4770db9c1059d2f8fe79fb29b7c2.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我们可以   而不   通知   APN   notification

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!