My app is developed using Unity3d (2018) and c#. The app is then build in Cloud Build for iOS. Now, I want to use a custom scheme to launch my iOS app and provide some extra information:
some-custom-scheme://some-parameter=some-value
I’ve read in the Unity forum that the best way to do this is to create a plugin in Unity and hook into the iOS startup pipeline as described in the forum post like this:
Within the app, I then simply check the PlayerPrefs like this:
var url = PlayerPrefs.GetString(“url”);
The url value however is empty. Iterating through the keys and alerting them in the app give two results: UIApplicationLaunchOptionsKey and UIApplicationLaunchOptionsSourceApplicationKey. Both irrelevant according the Apple documentation which state that the data should be in the UIApplicationLaunchOptionsAnnotationKey key.
I feel that I’m close but not there yet. What am I doing wrong and how can it be fixed? Which method is better? My approach using didFinishLaunchingWithOptions or the openURL method?
That link you gave says “If I’m not wrong…” and to try it… If I understood your original post correctly, the mapping is not there as one would think. If you’ve tried NSUserDefaults and cannot read it from PlayerPrefs, then there’s something off.