问题
Using a Standard Notification Hub, I want to view telemetry for a specific message using the returned NotificationId and either this rest API:
https://msdn.microsoft.com/en-us/library/azure/mt608135.aspx
or the NotificationHubClient GetNotificationOutcomeDetailsAsync method:
https://msdn.microsoft.com/en-us/library/microsoft.azure.notificationhubs.notificationhubclient.getnotificationoutcomedetailsasync.aspx
Either way, I need the Notification Message Id that is supposed to be returned from the hub when sending the message.
I am sending the message from the app backend using the SendTemplateNotificationAsync method:
NotificationOutcome result = await hub.SendTemplateNotificationAsync(params, tags);
After sending the template notification, the result.NotificationId property is empty. How can I get the NotificationId so I can then get the telemetry?
Update:
I tried setting the enableTestSend property to true when creating the NotificationHubClient. The result still does not contain a NotificationId.
Currently there is only one device (installation) registered in the hub. Could this be due to a low number of devices receiving the push?
回答1:
Posting this for the benefit of others who may encounter this issue.
I was contacted by an Azure support engineer who helped me resolve the problem. I had recently switched from the Free to the Standard tier, and there is a bug in Notification Hubs related to changing subscription tiers. This required the support engineer to "force sync the cache" - which resolved the issue.
The bug has been fixed and will be rolling out soon. If you encounter this issue I would suggest contacting Azure support.
来源:https://stackoverflow.com/questions/36557991/azure-notification-hub-why-is-notificationoutcome-notificationid-property-empty