I am in need of a way to make the user is taken to the Settings application to disable the multitasking gestures. I know that in iOS 8 you can launch the Settings application programmatically through the URL in Objective-C:
NSURL * url = [NSURL URLWithString: UIApplicationOpenSettingsURLString];
But I do not know how to get this URL in Unity to use with Application.OpenURL()
You need to write a tiny iOS plugin for that, here is more information about it: http://docs.unity3d.com/Manual/PluginsForIOS.html
And here is your solution, ask if something should be unclear.
Script/Example.cs
Plugins/MyNativeBindings.cs
Plugins/iOS/MyNativeBindings.mm
Using idea of JeanLuc, I create a empty XCode project and print the string constant
UIApplicationOpenSettingsURLString
and used in Unity with Application.OpenURL() to not have to use a plugin. Works very nice.The value for constant
UIApplicationOpenSettingsURLString
is: "app-settings:" (without quotas).Use:
Application.OpenURL("app-settings:")
to open directly from unityWARNING: The use of hardcoded strings is dangerous and can break your code if Apple change the value of constant
UIApplicationOpenSettingsURLString
. Its just a workaround while Unity does not add a constant for reference in C# code.