载入跨设备 Microsoft Graph 通知体验Onboarding to cross-device experiences for Microsoft Graph notifications

备注

如果仅针对 Web 终结点,则可以直接转到设置应用服务以发送通知。If you're only targeting web endpoints, you can go directly to setting up your app service to send notifications.

除了在 Azure 门户上注册应用外,应用程序还需要登记跨设备信息,如跨平台应用程序 ID 和跨平台推送凭据,以授权 Microsoft Graph 通过预每个操作系统(Windows、iOS 和 Android)对应的本机推送通知服务发送通知。In addition to app registration on Azure Portal, your application needs to register cross-device information such as cross-platform application id and cross-platform push credentials in order to authorizes Microsoft Graph to send notifications via native push notification services that correspond to each operating system: Windows, iOS, and Android. 这可通过合作伙伴中心仪表板(先前的 Windows 开发人员中心仪表板)完成。This is done through Partner Center dashboard (formerly Windows Dev Center dashboard).

备注

即使不打算构建 Windows UWP 应用程序,你也需要 Windows 开发人员帐户来完成本文中的步骤。You'll need a Windows developer account to complete the steps in this article, even if you don’t plan to build a Windows UWP application. 如果没有 Windows 开发人员帐户,请参阅开立开发人员账户If you don’t already have a Windows developer account, see Opening a developer account. 或者,如果不希望注册为 Windows 开发人员,可通过电子邮件 [gnsengage@microsoft.com](sendto: gnsengage@microsoft.com) 联系我们。Alternatively, if you prefer not to enroll as a Windows developer, you can reach out to us via email at [gnsengage@microsoft.com](sendto: gnsengage@microsoft.com). 如果创建 Windows 开发人员帐户且将学校或工作应用程序构建为企业的一部分,则可以将开发人员帐户与用于管理企业提交的相应 Azure AD 帐户关联在一起。If you’re building a school or work application as part of an enterprise, you can associate your developer account with the appropriate Azure AD account that is used for managing your enterprise submissions. 有关详细信息,请参阅关联 Azure Active Directory 与合作伙伴中心帐户For details, see Associate Azure Active Directory with your Partner Center account.

若要开始使用,请使用 Windows 开发人员帐户登录合作伙伴中心仪表板To get started, sign in to the Partner Center dashboard using your Windows developer account (you cannot use an Azure AD account):

  1. 在左侧菜单上,转至“跨设备体验”,选择“配置新的跨设备应用”,然后提供应用名称,如下面的屏幕截图所示。On the left menu, go to Cross-Device Experiences, select Configuring a new cross-device app, and provide your app name, as shown in the following screenshot.

配置新的跨设备应用注册

  1. 选择应用具有状态且可以接收通知的所有受支持平台。Select all supported platforms where your app will have a presence and be enabled to receive notifications. 可以从受支持平台(包括 Windows、Android 和 iOS)中进行选择,如图所示。You can select from supported platforms that include Windows, Android, and iOS, as shown. 

设置受支持的平台类型

  1. 为应用具有状态的每个平台提供应用 ID,如图所示。Provide app IDs for each of the platforms where your app has a presence, as shown.

提供平台特定的应用 ID

备注

可以为每个平台添加不同 ID(最多十个) – 这是为了以防同一应用的多个版本或者不同应用希望接收由应用服务器发送的针对相同用户的相同通知。You can add different IDs (up to ten) per platform – this is in case you have multiple versions of the same app, or even different apps, that want to be able to receive the same notification sent by your app server and targeted to the same user.

  1. 从 Microsoft 帐户和/或 Azure AD 应用注册提供或选择应用 ID。Provide or select the app ID from Microsoft account and/or Azure AD app registration. 此客户端 ID 对应于 Microsoft 帐户或在 Azure 门户中注册时获取的 Azure AD 应用注册。This client ID corresponds to the Microsoft account or Azure AD app registration that you obtained when you register in the Azure Portal.

为 MSA 和 AAD 提供 Azure 应用注册客户端 ID

  1. Microsoft Graph 通知使用所有主要平台上的各个本机通知平台向应用客户端终结点(也就是 WNS - Windows UWP、FCM - Android 和 APNS - iOS)发送通知。Microsoft Graph notifications use each of the native notification platforms on all major platforms to send notifications to the app client endpoints, namely, WNS (for Windows UWP), FCM (for Android), and APNS (for iOS). 提供这些通知平台的凭据,使 Microsoft Graph 通知在你发布针对用户的通知时传递应用服务器通知,如图所示。Provide your credentials for these notification platforms to enable Microsoft Graph notifications to deliver notifications for your app server when you publish user-targeted notifications, as shown.

提供跨设备推送凭据

备注

对于 Windows UWP 应用,启用 WNS 推送通知是使用 Microsoft Graph 通知的前提条件。For Windows UWP apps, enabling WNS push notification is a prerequisite to using Microsoft Graph notifications. 有关详细信息,请查阅 WNS 概述For details, see WNS overview. 载入后,可以通过合作伙伴中心向连接设备平台提供推送凭据。After you onboard, you can provide push credentials via Partner Center to the Connected Device Platform.

  1. 验证跨设备应用域,这将用作验证流程以证明你的应用程序拥有此域的所有权。Verify your cross-device app domain, which serves as a verification process to prove that your application has ownership of this domain. 这就好比所注册的应用的跨设备应用标识,如图所示。This acts like a cross-device app identity for the application or applications you registered, as shown.

    验证域

搞定!That’s it! 你现在已注册应用程序以接收通知。You've now registered your applications to receive notifications. 接下来,了解如何设置应用服务并开始发送通知。Next, learn how to set up your app service and start sending notifications.