URL scheme to launch Unity3d app in iOS

Hi everyone.

I’ve made a Unity3d iOS app which has two modes internally: Mode A and Mode B, which do different things within the app. There’s gonna be another iOS app (non Unity3d) which can
launch my app in either mode via the iOS URL scheme. For example: to launch my app in mode A, the URL to be called will be something like project:\\modeA and project:\\modeB to launch mode B.

Now I know that the UIApplication delegate in Unity3D is the AppController.mm file which is created once we’ve built the project.

My question is: how do I pass these URL parameters to the Unity app which determine the mode to be opened under ? And how should a Unity script do the polling to find out about the parameters and start the app in a particular mode ?

Any help in this regard is appreciated.

I think what you search is here :

You must probably use the Unity/XCode call back.

So to do that you probably gonna use : UnitySendMessage(“GameObjectName1”, “MethodName1”, “Message to send”);

I don’t know if it’s exactly what you need but I think It’s a good start ;). I’m still searching…

You are right. I need to create a plugin that’s coded in Objective C which passes parameters via the URL method to the Unity3d app. Using those parameters I could enable the different modes within the game. Also, I’m guessing this plugin would need to be added to the libraries in the xcode project.