Push Notifications


Before you can use Remote (Push) notification with the IOS Native plugin you need to enable this API with the editor settings. Navigate to the:

Windows → Stan's Assets → IOS Native → Edit Settings

and enable push notifications API. Make sure you do not live it enabled without using a push notification in your build. It may cause App Store review problems.


First of all, you need to request push notifications permission for your  app and retrieve the device token. See the code example bellow:

ISN_RemoteNotificationsController.Instance.RegisterForRemoteNotifications ((ISN_RemoteNotificationsRegistrationResult result) => {
    if(result.IsSucceeded) {
        Debug.Log ("DeviceId: " + result.Token.DeviceId);
    } else {
        Debug.Log ("Error: " + result.Error.Code + " / " + result.Error.Message);

Once Token is received, you may send this device token to your server, and it will now able to send a remote notification to this device.  Please note, that you can always find out  current user notification Settings.

If you need help with your application configuration inside iTunes Connect, and Xcode. Please point your browser to a Setup and test push notifications guide.

Remote notifications in runtime

If you want to know if app received push notification in runtime, you can subscribe to the OnRemoteNotificationReceived action, as showed in the code snippet bellow.

ISN_RemoteNotificationsController.OnRemoteNotificationReceived  += HandleOnRemoteNotificationReceived;

void HandleOnRemoteNotificationReceived (ISN_RemoteNotification notification){
    IOSMessage.Create("Remote Notification Received", "Body: " + notification.Body);

If you app was launched from the notification, you get the notification object from the LaunchNotification getter.  If you app was launched normally, the LaunchNotification  will remain null. Code snippet bellow shows how to check if app was launched from the local notification and print notification data.

if(ISN_RemoteNotificationsController.Instance.LaunchNotification != null) {
	ISN_RemoteNotification notification = ISN_RemoteNotificationsController.Instance.LaunchNotification;
	IOSMessage.Create("Launch Remote Notification", "Body: " + notification.Body);


The device token is your key to sending push notifications to your app on a specific device. Device tokens can change, so your app needs to reregister every time it is launched and pass the received token back to your server. If you fail to update the device token, remote notifications might not make their way to the user’s device. Device tokens always change when the user restores backup data to a new device or computer or reinstalls the operating system. When migrating data to a new device or computer, the user must launch your app once before remote notifications can be delivered to that device.