SHARE
TWEET

PlayerIO Notification

Frank84 Aug 2nd, 2016 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top