Embed in iOS apps¶
This page explains how to embed a Minsar experience in your iOS (Swift) app and explains the scenarios and options available.
iOS Embed will be available to all Minsar users by the end of the year.
Beta Testers only
The documentation below only applies to Minsar Insiders using a pre-release version of Minsar.
MinsarKit SDK requires:
- Xcode 11+
- iOS SDK 13+
MinsarKit can easily be added to your project using CocoaPods or by adding the
MinsarKit.framework file in the
Embedded Binaries section of your Xcode project.
You may update your
Podfile as below:
platform :ios, '13.0' target '%APP_NAME%' do use_frameworks! pod ‘MinsarKit', :http => "https://minsar.dev/sdks/ios/latest.zip" end
MinsarKit SDK must be initialized before attempting to open an experience:
The API Key can be retrieved in the Portal.
This call will throw if the
apiKey is invalid, or if the device doesn't support AR.
The SDK can be safely initialized at any moment, such as in your AppDelegate's
Before quitting, the
MinsarKit should be destroyed:
Play an experience¶
Once the SDK is initialized, developers can play an experience with a single line of code:
MinsarKit.shared.play(experienceId: String, renderer: MTKView?)
renderer parameter is optional: if it isn't set, MinsarKit will play the experience in fullscreen.
It will throw if:
experienceIdis invalid (bad formatting)
- the experience is not found or has no associated Launch Plan
- the device can't play this experience
MinsarKitcan’t open this experience for compatibility reasons
- You can then redirect the user to our XR View app
MinsarKitis already playing an experience
Developers are responsible of stopping the experience visualization: