I am trying to launch an app from Safari using a Custom URL Scheme and obtain the parameters specified in the URL.
In Window mode, the app was able to launch and retrieve the parameters. However, in Poly Spatial (Bounded/Unbounded), the app launches but couldn’t receive the parameters.
If anyone has tried something similar, I would appreciate any information.
I am trying this by creating a plugin based on the implementation found here:
I solved this by taking the URL in SwiftUI and communicating it to the Unity layer.
Here is my solution
Registration of URL Scheme Go to Project Settings > Player > ‘iOS’ tab > Other Settings > Configuration. Change the size of ‘Supported URL Scheme’ to 1 and input any desired URL Scheme into Element 0.
*This item does not exist in Vision OS, but when entered on the iOS side, it was reflected.
Add onOpenURL() to PolySpatialContentViewWrapper
Modify the com.unity.polyspatial.visionos package so that the addition of .onOpenURL is reflected in UnityVisionOSSettings.swift.
Upon investigation, I found that PolySpatial does not use NotificationCenter for onOpenURL notification as expected when executing Custom URL Scheme.
In Window mode, the following methods are called, and finally AppController_SendNotificationWithArg method notifies Observers of onOpenURL using NSNotificationCenter.