IOS platformunu kullanarak Yayın bildirim gönder aşağıdaki biçimde JSON yükü gönderir: Android yük biçimidirIOS için gök mavisi ve android
{"aps":{"alert":"Notification Hub test notification"}}
oysa:
{"data":{"message":"Notification Hub test notification"}}
Benim SendBroadcastNotification
:
public void SendBroadcastNotification(string message) {
NotificationHubClient hub = NotificationHubClient
.CreateClientFromConnectionString(Constants.NotificationsHubConnectionString, "QiKStayNotificationHub",true);
var notify = "{ \"data\" : {\"message\":\"" + message + "\"}}";
var appnotify = "{ \"aps\" : {\"alert\":\"" + message + "\"}}";
var task = hub.SendGcmNativeNotificationAsync(notify);
task.Wait();
}
Buradan itibaren özellikle SendWcmNativeNotificationAsync'e bildiriyorum. Tüm cihazlar için yayın ant. Eğer sürdürmesi gerektiğini bildirim göbeğine kullanıcının platformu ile cihazı kaydederken aynı şekilde
hubClient.SendAppleNativeNotificationAsync();
hubClient.SendGcmNativeNotificationAsync(notify);
SendGcmNativeNotificationAsync, tüm android cihazlara ve SendAppleNativeNotificationA'ya yayın yapacak Senkronizasyon tüm apple cihazlarına yayınlayacaktır – Mahesh