简体   繁体   中英

How to send a notification to a specific APNS notification token using Azure Notification Hub

I am currently using the below code, which sends to all the devices with the tags specified in the enumerable tag argument. However, I want to send to a device with a specific notification token. The below works but I cannot find an overload that simply takes the APNS token?

NotificationService.Instance.Hub.SendAppleNativeNotificationAsync(jsonPayload, userTag);

To send to a specific handle (APNS token in this case) you use 'SendDirectNotificationAsync' and it is not specific to Apple, Windows, or FCM because under the covers the framework knows since during the registration of the handle you would have specified the platform. The signature is as below:

 SendDirectNotificationAsync (Notification notification, 
    string deviceHandle, CancellationToken cancellationToken);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM