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);