Web 应用程序与 iOS 应用程序交互以发送通知

发布于 2024-12-01 14:41:42 字数 225 浏览 4 评论 0原文

我有一个基本的 Web 应用程序,能够将推送通知(通过 UrbanAirship)发送到我的 iOS 应用程序。

我的问题是,我的 web 应用程序如何知道我有一个新的 iOS 应用程序用户?因此,我可以将推送的 DeviceID 放入数据库(以及所需的其他数据)。

即,将数据获取到 Web 应用程序的接口是什么,它是 iOS 应用程序中的新代码,还是 UA 中还有其他接口?

谢谢..

I have a basic web app that is able to send push notifications (via UrbanAirship) to my iOS app.

My questions is, how can my webapp know that I have a new iOS app user? So I can then put the push DeviceID into a database (along with other data as required).

i.e. what is the interface for getting data into the Webapp, is it new code in the iOS app, or is there some other interface from UA?

Thanks..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花伊自在美 2024-12-08 14:41:42

我不是 iOS 开发人员,所以我很难说得太具体,但我假设您需要存储设备 ID 和(可能)令牌,以便可以向该设备发送消息。我(还)假设您可以在设备上访问此信息。

正确的方法是创建设备的数据存储表以及与它们相关的信息(令牌、各种 ID,我还想知道上次向它们发送消息的时间等),然后发送一个请求(应该当用户注册其设备时,可以是对您的应用程序的 POST 请求(语义上)。在 POST 请求中发送所需的信息,然后通过处理程序将其存储在数据存储中。

希望有帮助吗?这就是 Android 云到设备消息的处理方式,根据我对 Urban Airship 的快速浏览,他们的服务也是这样工作的。

I'm not an iOS developer, so it's hard for me to be too specific, but I'm assuming you need to store a device ID and (possibly) a token so that you can send messages to that device. I'm assuming (also) that you have access to this information on the device.

The correct way to do this would be to create datastore table of devices and the information associated with them (tokens, various IDs, I also like to have the last time I sent them a message, etc.) Then you send a request (should be a POST request, semantically) to your app when the user registers their device. Send the information you need in the POST request, then store it in your datastore through a handler.

Hope that helps? That's how things are done with Android Cloud to Device messages, and from my quick perusal of Urban Airship, that's how their service works, too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文