我有兩個通知中心客戶端(nodejs和C#),都用於推送消息到集線器。通知中心傳遞失敗C#
節點客戶端發送完美,但C#客戶端完成沒有消息正在發送。
下面是用於每個客戶端的片段。
C#
NotificationHubClient hub = NotificationHubClient.CreateClientFromConnectionString("<Connection String>", "<Hub Name>");
var notice = @"{'aps':{'alert':'Notification Hub test notification'}}";
var result = await hub.SendAppleNativeNotificationAsync(notice, "<tag>");
Console.WriteLine(result.State);
的NodeJS
var azure = require('azure');
var notificationHubService = azure.createNotificationHubService('<Hub Name>','<Connection String>')
var notice = "{'aps':{'alert':'Notification Hub test notification'}}"
notificationHubService.apns.send("<tag>", notice, function(error, res){
console.log(res);
});
發送Android的通知和消息直接從Azure的門戶測試功能發送時都工作得不錯的罰款。
任何援助將不勝感激。
我檢查了這一點,有效負載是有效的,結果的狀態是「入隊」。如果我有目的地對有效載荷進行格式化,我會得到「(400)錯誤請求,提供的通知載荷無效」。 –
@Duncan一旦發送通知,你的設備註冊是否被丟棄? –
不通知通知中心上的註冊仍然存在,我仍然可以從節點客戶端推送。 –