Reputation: 93
I want to send push notifications to a iphone. It works fine if I send a message from the Azure Notification Hub - Website, but I can't send a notification from my c# console application.
I have added the Microsoft.Azure.NotificationHubs - Nuget Package,
var client = NotificationHubClient.CreateClientFromConnectionString ( HUBLISTENACCESS, HUBNAME );
client.SendAppleNativeNotificationAsync ( json ).ContinueWith (
t => {
Console.WriteLine (t.Result );
} );
Console.ReadLine();
but it raises an exception "not authorized 401".
I hope anyone could help. Regards Ronny
Upvotes: 1
Views: 1065
Reputation: 96
var client = NotificationHubClient.CreateClientFromConnectionString ( HUBLISTENACCESS,
The problem is that LISTENACCESS key doesn't have permissions for SendOperations. Can you try with FULLACCESS keys?
Upvotes: 7