← back


iOS Features


IDFV

You can retrieve the ID for Vendors by invoking:

var vendorId = NativeEssentials.Instance.VendorId;


Notification Permissions & APN Registration

Before you can receive either Local or Remote notifications, you will need to have player grant the required permissions. The native notification permission request dialog can be invoked by executing:

NativeEssentials.Instance.RequestIosNotificationApproval();

Note: Invoking this method will also trigger the registration process with APN, in order to obtain a remote push notification token (see below).


Remote Notification Registration Token

This token can then be provided to various 3rd party services that can handle APN delivery. The push token registration request is handled by the NativeEssentials.Instance.RequestIosNotificationApproval mentioned above. The resulting token can be retrieve by registering the following callback prior to invoking the above mentioned NativeEssentials.Instance.RequestIosNotificationApproval call:

NativeEssentials.OnIosPushTokenRetrieved += (bytePushToken) =>
{
    // bytePushToken will be of type byte[]
};

bytePushToken will be of type byte[]. To convert this value, the following helper is available:


Debug.Log(string.Format("[iOS Notifications] Retrieved iOS push token: {0}",
                NativeEssentials.ConvertPushTokenBytesToString(bytePushToken)));
};

After the token has been retrieved, you can also access it via:

byte[] iosPushToken = NativeEssentials.Instance.IosPushtoken;


Badge Count

You can set the badge count (on the home screen's icon) by using the following:

NativeEssentials.Instance.SetBadgeCount(3); // set badge count of 3

NativeEssentials.Instance.SetBadgeCount(0); // clears the badge count


Testflight vs App Store Build Count

In ome cases, you might want to determine if the build is installed via Testflgiht or App Store. This could be helpful for example, when you wish to determine if sandbox or production IAP receipt are in use:

bool isTfBuild = NativeEssentials.Instance.IsTestflightBuild

Note: Returns a bool value, true for Testflight and dev builds, false for App Store builds