单个设备单个应用程序的多个 WNS access_token?

Multiple WNS access_token for a single device single App?

我在一台 Windows 设备上安装了一个应用程序 运行。在使用 WNS 对其进行身份验证时,我在响应中收到 access_token。

是否可以请求多个access_token?是否会使之前为同一 App 同一设备生成的 access_token 失效? 即对于单个设备上的应用程序,我们可以支持多个 access_tokens 吗?

Is it possible to make a request for more than one access_token?

不,一次身份验证请求只会 return 一次 access_token。但是我们可以发送多个认证请求来获取多个access_tokens.

Will it invalidate the previously generated access_tokens for the same App same device?

不,access_token是独立的,过期不会失效


我不确定为什么需要多个 access_tokens 支持。正如 Windows Push Notification Services (WNS) overview 所述:

The access token described above can be reused for multiple notification requests; the cloud server is not required to request a new access token for every notification. If the access token has expired, the notification request will return an error. We recommended that you do not try to re-send your notification more than once if the access token is rejected. If you encounter this error, you will need to request a new access token and resend the notification.

所以对于一个频道 URI,我们不需要多个 access_tokens。

但是,如果您的应用要向多个应用发送推送通知,则需要多个 access_token

An access token only allows a cloud service to send notifications to the single app for which the token was created. One access token cannot be used to send notifications across multiple apps. Therefore, if your cloud service supports multiple apps, it must provide the correct access token for the app when pushing a notification to each channel URI.

对于这种情况,您需要为多个应用的​​每个 client_idclient_secret 请求多个 access_token