I am developing an ios app.
I can start the app via my URL scheme very simply.
But how can I access the arguments within the URL?
My URL is like myApp://host/key=value
You have to write an interface for the AppController to overwrite the function “didFinishLaunching” with “didFinishLaunchingWithOptions”.
I found that on google.
Then you have to tell unity the result via UnitySendMessage(“GameObject”, “Function”, result);
But this just working if the “Function” was written in CS, never succeded in JS. I don’t know why.
So you can access the arguments and in my case I just used String that I can parse as I need it.
Hope it helps others and don’t hesitate to ask for specific code explanation.
Just add a category that implements the function, takes the custom argument, stores it into NSUserDefaults and sync and then call didFinishLaunching
if you ask yourself why NSUserDefaults: this maps to PlayerPrefs inside of Unity and is persistent, so you don’t risk that the data could be lost anyway.
Dear Sir, I cannot express how much I owe you a beer. I WILL raise a glass to you tonight as this was the last thing for my project. You have answered a whole week of headaches for me.