与应用服务移动应用集成Integration with App Service Mobile Apps

为了在 Azure 服务之间促成无缝且统一的体验,应用服务移动应用原生支持使用 Azure 通知中心的通知。To facilitate a seamless and unifying experience across Azure services, App Service Mobile Apps has built-in support for notifications using Azure Notification Hubs. 应用服务移动应用提供面向企业开发人员和系统集成商的高度可缩放、全局可用的移动应用程序开发平台,该平台向移动开发人员提供一组丰富的功能。App Service Mobile Apps offers a highly scalable, globally available mobile application development platform for enterprise developers and systems integrators that brings a rich set of capabilities to mobile developers.

移动应用开发人员可以借助以下工作流来使用通知中心:Mobile Apps developers can use Notification Hubs with the following workflow:

  1. 检索设备 PNS 句柄。Retrieve device PNS handle.

  2. 使用移动应用客户端 SDK 注册 API 将设备注册到通知中心。Register device with Notification Hubs using Mobile Apps client SDK registration APIs.

    备注

    请注意,出于安全方面的考虑,移动应用会在注册中去除所有标记。Note that Mobile Apps strips away all tags on registrations for security purposes. 直接从后端使用通知中心将标记与设备相关联。Work with Notification Hubs from your backend directly to associate tags with devices.

  3. 从应用后端使用通知中心发送通知。Send notifications from your app backend with Notification Hubs.

此集成提供的一些优势包括:Some advantages this integration provides are:

  • 移动应用客户端 SDK:这些多平台 SDK 提供用于注册的 API,并与链接到移动应用的通知中心通信。Mobile Apps Client SDKs: These multi-platform SDKs provide APIs for registration and communicate with the notification hub that's linked with the mobile app. 不需要通知中心凭据,也不需要使用其他服务。You do not need Notification Hubs credentials, or work with an additional service.
    • 推送到用户:SDK 将使用移动应用的已经过身份验证的用户 ID 来自动标记指定设备,以实现“推送到用户”的方案。Push to user: The SDKs automatically tag the specified device with a Mobile Apps authenticated User ID to enable the "push to user" scenario.
    • 推送到设备:SDK 自动使用移动应用安装 ID 作为 GUID 来注册通知中心,因此无需维护多个服务 GUID。Push to device: The SDKs automatically use the Mobile Apps Installation ID as a GUID to register with Notification Hubs, so there's no need to maintain multiple service GUIDs.
  • 安装模型:移动应用使用通知中心最新推送模型来呈现 JSON 安装中所有与设备关联的推送属性,该模型与推送通知服务密切合作且易于使用。Installation model: Mobile Apps works with the Notification Hubs latest push model to represent all push properties associated with a device in a JSON installation that aligns with Push Notification Services and is easy to use.
  • 灵活性:即使在集成环境中,开发人员也始终可以选择直接使用通知中心。Flexibility: Developers can always choose to work with Notification Hubs directly even with the integration in place.
  • Azure 门户中的集成体验:Mobile Apps 以可视化方式呈现推送功能,开发人员可以通过 Mobile Apps 轻松使用关联的通知中心。Integrated experience in the Azure portal: Push as a capability is represented visually in Mobile Apps and developers can easily work with the associated notification hub through Mobile Apps.