我试图了解典型的 Web API 如何向 native 应用程序发送通知。阅读更多内容后,我变得更加困惑,因为有很多工具可以管理部分通知。
据我了解,默认流程是:
- 网络 API 中发生一些操作,我们需要发出推送通知
- 我们找出哪些用户需要接收此推送通知
- 使用 Azure 通知中心等工具发送通知
- 以某种方式将 Azure 通知中心集成到 Xamarin 解决方案中
这只是留下了几个问题。
首先:如何将用户映射到特定应用程序?其次,您在应用程序网站上使用什么工具?我想该应用程序需要以某种方式“注册”?
我希望有人能够阐明这个过程。
最佳答案
如这个tutorial iOS 的推送通知拓扑如下:
At the center of push notifications in iOS is the Apple Push Notification Gateway Service (APNS). This is a service provided by Apple that is responsible for routing notifications from an application server to iOS devices.
在 iOS 应用程序可以接收远程通知之前,您需要向 APNS 注册您的 iOS 应用程序。而 APNS 会返回一个设备 token 给你的 iOS 应用程序,然后你需要将设备 token 注册到你的应用程序服务器或 Azure 通知中心进行注册。然后,应用程序服务器或 Azure 通知中心将使用设备 token 将通知推送到特定移动设备。有关更多详细信息,您可以引用上述教程中的注册 APNS 部分。下图说明了注册和获取设备 token 的过程:
How do I map a user to a specific app?
在 APNS 注册后,您可以将设备 token 连同可以识别特定用户的标签一起注册到您的应用程序服务器或 Azure 通知中心。下面是上述通知中心场景的示意图,您可以引用:
what tool do you use on the app site?
我更愿意使用 Microsoft Azure 通知中心,您可以使用相关的 SDK 将通知推送到所有客户端或具有特定标签的客户端。更多详情,您可以引用Sending Push Notifications .
此外,要将 Xamarin 应用连接到通知中心,您可以引用 here .有关 Xamarin 应用程序使用通知中心的 iOS 推送通知的详细步骤,您可以引用here .
关于ios - 在 Xamarin 上推送通知的 Web API - 流程是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46103703/