Ich versuche Push-Benachrichtigungen mit Azure Notification Hub und Xamarin.Mac zu senden. Ich habe diesen Fehler, und ich weiß nicht warum. Jemand kann mir helfen, damit umzugehen?Xamarin.Mac - Benachrichtigung senden
Der Fehler:
System.TypeInitializationException: The type initializer for 'TimerManager' threw an exception. ---> System.EntryPointNotFoundException: CreateWaitableTimer
Mein Code:
private static async void SendNotificationAsync()
{
NotificationHubClient hub = NotificationHubClient
.CreateClientFromConnectionString("<connection string>", "<hub name>");
string toast = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<wp:Notification xmlns:wp=\"WPNotification\">" +
"<wp:Toast>" +
"<wp:Text1>Content</wp:Text1>" +
"</wp:Toast> " +
"</wp:Notification>";
await hub.SendMpnsNativeNotificationAsync(toast);
}
Vielen Dank für Ihre Antwort, werde ich den REST-aPI verwenden. Es scheint, dass es die beste Lösung für mein Problem ist :) Vielen Dank! –