private string GetNotificationToken(SendNotificationResult result) { var token = string.Empty; var notification = result.Notification; if (notification is AppleNotification) token = (notification as AppleNotification).DeviceToken; else if (notification is GcmNotification) token = (notification as GcmNotification).RegistrationIds.Single(); return token; }
private void SendNotificationCallbackDelegate(object sender, SendNotificationResult result) { if (result.IsSuccess) { log.Info("Success sending notification for token: " + GetNotificationToken(result) + "Notification " + result.Notification.ToString(), result.Error); } else { log.Error("Fail to send notification for token:" + GetNotificationToken(result) + "Error " + result.Error.ToString() + "Notification " + result.Notification.ToString(), result.Error); } }