System Utilities

Getting the Advertising Identifier

Unlike the identifierForVendor property of the UIDevice, the same value is returned to all vendors. This identifier may changeâfor example, if the user erases the deviceâso you should not cache it.

If the value is null, wait and get the value again later. This happens, for example, after the device has been restarted but before the user has unlocked the device.

The code snippet bellow shows how you can retrieve the Advertising Identifier

IOSSharedApplication.OnAdvertisingIdentifierLoadedAction += OnAdvertisingIdentifierLoadedAction;

void OnAdvertisingIdentifierLoadedAction (string Identifier) {
	IOSMessage.Create("Identifier Loaded", Identifier);

The feature is disabled by default, in order to enable this feature, you need to recommend method inside the file.

Open, find the GetIFA method, and remove comments:

- (void) GetIFA {
    NSString* ifa;
    #if UNITY_VERSION < 500
    ifa = [[[NSClassFromString(@"ASIdentifierManager") sharedManager] advertisingIdentifier] UUIDString];
    ifa =  [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
    ifa = [[ifa stringByReplacingOccurrencesOfString:@"-" withString:@""] lowercaseString];
    NSLog(@"IFA: %@",ifa);
    UnitySendMessage("IOSSharedApplication", "OnAdvertisingIdentifierLoaded", [ISN_DataConvertor NSStringToChar:ifa]);

Warning: For Unity version 5+ you also need to add following include line at the beginning of the script

#import <AdSupport/ASIdentifierManager.h>

Application Bages Number

You can control application badges count with IOS Native. For example if you want to set badge number to 18 as on the picture bellow:

You can achieve it with the code showed bellow:


And if you want to clear all badges simply set badges number to 0


Device GUID

Part from the Apple documentation:

The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.

The value of this property may be nil if the app is running in the background, before the user has unlocked the device the first time after the device has been restarted. If the value is nil, wait and get the value again later.

The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.

In Short:

The identifier for a particular vendor will remain the same if at least one app by that vendor remains on the device. Once there are no more apps left (or in the case of a single app, it is reinstalled), the identifier can and will change. As far as I know, there should not be a difference on iOS 6 vs iOS 7, so any difference you are seeing is coincidental.

Device GUID retrieve example

Retrieving the Device GUID is now the part of ISN_Device class.

Open Application Appstore Page.

The following function call will open your application AppStore page:


Or you can always specify Application Apple Id which want to open in the AppStore application. For example we want to redirect user to the Facebook AppStore page

string appleId = "284882215";

Guided Access

You can use Guided Access to:

  • Temporarily restrict your iOS device to a single app
  • Disable areas of the screen that aren’t relevant to a task, or areas where an accidental gesture might cause a distraction
  • Disable the hardware buttons

Set up Guided Access

Tap Settings > General > Accessibility > Guided Access to set up Guided Access. From there, here's what you can do:

  • Turn Guided Access on or off 
  • Set a passcode that controls the use of Guided Access and prevents someone from leaving an active session
  • Set whether the device can go to sleep during a session

Start a Guided Access session

To start a Guided Access session, follow these steps:

  1. Open the app you want to use.
  2. Triple-click the Home button.
  3. Adjust settings for the session, and then tap Start.

The IOS Native plugin allows to check is Guided Access was enabled or not as showed with the code snippet bellow.

if(IOSNativeUtility.IsGuidedAccessEnabled) {
	Debug.Log("Guided Access Enabled");
} else {
	Debug.Log("Guided Access Disabled");

If Guided Access is Enabled you can start / stop Guided Access Session:

bool enabled = true;
IOSNativeUtility.GuidedAccessSessionRequestResult += HandleGuidedAccessSessionRequestResult;
void HandleGuidedAccessSessionRequestResult (bool didSucceed) {
	Debug.Log("Guided Access Session Request Result: " + didSucceed);

Testflight/Sandbox vs production

IOS Native now allow you to detect is app was downloaded from the app store, or running from testflight/sandbox. This made it easy to make modifications to beta builds, such as exposing additional settings the app to let testers test things more thoroughly and see more technical information about the status of the app.

You may detect app mode with the following getter:


Note: Always  returns true while running in Unity editor mode.


The default locale is appropriate for tasks that involve presenting data to the user. In this case, you want to use the user's date/time formats, number formats, rules for conversion to lowercase, and so on. In this case, it's safe to use the convenience methods.

The default locale is not appropriate for machine-readable output. The best choice there is usually Locale.US â this locale is guaranteed to be available on all devices, and the fact that it has no surprising special cases and is frequently used (especially for computer-computer communication) means that it tends to be the most efficient choice too.

Following code snippet shows how to retrieve basic Locale info:

IOSNativeUtility.OnLocaleLoaded += GetLocale;

private void GetLocale (ISN_Locale locale){

		IOSNativePopUpManager.showMessage("Locale Info:", "Country:" + locale.CountryCode + "/" 
		                          + locale.DisplayCountry + "  :   " + "Language:" 
		                          + locale.LanguageCode + "/" 
		                          + locale.DisplayLanguage);
		IOSNativeUtility.OnLocaleLoaded -= GetLocale;

The locale info is represented as the AN_Locale object.

public class ISN_Locale  {

	//Returns the country code for this locale, or "" if this locale doesn't correspond to a specific country.
	private string _CountryCode;
	//Returns the name of this locale's country, localized to locale. Returns the empty string if this locale does not correspond to a specific country.
	private string _DisplayCountry;
	//Returns the language code for this Locale or the empty string if no language was set.
	private string _LanguageCode;
	//Returns the name of this locale's language, localized to locale. If the language name is unknown, the language code is returned.
	private string _DisplayLanguage;

	public ISN_Locale(string countryCode, string contryName, string languageCode, string languageName) {
		_CountryCode = countryCode;
		_DisplayCountry = contryName;
		_LanguageCode = languageCode;
		_DisplayLanguage = languageName;

	public string CountryCode {
		get {
			return _CountryCode;

	public string DisplayCountry {
		get {
			return _DisplayCountry;

	public string LanguageCode {
		get {
			return _LanguageCode;

	public string DisplayLanguage {
		get {
			return _DisplayLanguage;