1
我试图用Azure通知中心和Xamarin.Mac发送推送通知。 我有这个错误,我不知道为什么。有人可以帮我处理它吗?Xamarin.Mac - 发送通知
错误:
System.TypeInitializationException: The type initializer for 'TimerManager' threw an exception. ---> System.EntryPointNotFoundException: CreateWaitableTimer
我的代码:
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);
}
谢谢您的回答,我会使用REST API。它似乎是我的问题的最佳解决方案:)非常感谢! –