Advertisement
Frank84

PlayerIO Notification

Aug 2nd, 2016
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. // Show the notification popup
  2. UnityEngine.iOS.NotificationServices.RegisterForNotifications(UnityEngine.iOS.NotificationType.Alert |
  3.                                                               UnityEngine.iOS.NotificationType.Badge |
  4.                                                               UnityEngine.iOS.NotificationType.Sound);
  5.  
  6. // Once the token is received, register endpoint
  7. m_mainClient.Notifications.RegisterEndpoint("ios-push-notifications", m_deviceToken, null, true, OnEndpointRegistered);
  8.  
  9. // Later on we send a notification
  10. Notification notification = new Notification(targetUsername, "ios-push-notifications");
  11. notification.Set("alert", notificationMessage);
  12. notification.Set("sound", "default");
  13. Notification[] notifications = new Notification[1];
  14. notifications[0] = notification;
  15. m_mainClient.Notifications.Send(notifications, OnNotificationSent, OnNotificationFailed);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement