System Utilities

Application Bages Number

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

You can achieve it with the code showed bellow:

IOSNativeUtility.SetApplicationBagesNumber(18);

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

IOSNativeUtility.SetApplicationBagesNumber(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:

IOSNativeUtility.RedirectToAppStoreRatingPage();

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";
IOSNativeUtility.RedirectToAppStoreRatingPage(appleId);

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;
IOSNativeUtility.Instance.RequestGuidedAccessSession(enabled);
	
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:

IOSNativeUtility.IsRunningTestFlightBeta

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

Copy to Clipboard

IOSNativeUtility.CopyToClipboard(string text)