XR
Manage Immersive Experiences.
+XR
Manage Immersive Experiences.
Methods
requestSession
-requestSession: (sessionId?: string) => Promise<void>
Opens a new ImmersiveSpace given it's unique Id.
requestSession: (sessionId: string, userInfo?: Object) => Promise<void>
Opens a new ImmersiveSpace given it's unique Id. Can also accept userInfo object that get's passed to the SwiftUI view, checkout use SwiftUI to render windows to learn more.
Opening an ImmersiveSpace can fail in following scenarios:
ImmersiveSpaceis not declared.UIApplicationSupportsMultipleScenesis set tofalse.
@@ -21,10 +21,6 @@
endSession
endSessionendSession: () => Promise<void>
Closes currently open ImmersiveSpace.
Constants
-supportsMultipleScenes
-supportsMultipleScenes: boolean;
A Boolean value that indicates whether the app may display multiple scenes simultaneously. Returns the value of UIApplicationSupportsMultipleScenes key from Info.plist.
UIApplicationSupportsMultipleScenes
In order to use this API, make sure your app supports multiple scenes. Set UIApplicationSupportsMultipleScenes to true in Info.plist:
<dict>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationPreferredDefaultSceneSessionRole</key>
<string>UIWindowSceneSessionRoleApplication</string>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict/>
</dict>
</dict>
</plist>
Make sure to set UIApplicationSupportsMultipleScenes to true in Info.plist as described here.