Flyreel SDK
Installation
Cocoapods
Add pod Flyreel
to your Podfile
pod Flyreel
Swift Package Manager
- Follow the Apple guide to add the package dependency to your app.
- Search for the
https://github.com/Flyreel/flyreel-sdk-ios
package.
Initialization
To use the Flyreel SDK, you must provide a configuration with the following parameters:
settingsVersion
: Identifier of your remote SDK settings.
organizationId
: Identifier of your organization.
let configuration = FlyreelConfiguration(
settingsVersion: "1",
organizationId: "7d3899f1421a7650241516475"
)
FlyreelSDK.shared.set(configuration: configuration)
Setting up the configuration is mandatory. Attempting to open the SDK flow without it will result in a fatal error.
Permissions
Since the SDK actively uses some functionalities of the iOS system you need to provide a few permission settings
<key>NSCameraUsageDescription</key>
<string>We need access to the camera.</string>
<key>NSMicrophoneUsageDescription</key>
<string>We need access to the camera.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We need access to your location data</string>
How to present UI
SwiftUI
For SwiftUI, use our custom modifier similar to a regular sheet presentation:
@State private var isFlowPresented = false
var body: some View {
Button("Open Flyreel flow") {
isFlowPresented = true
}
.presentFlyreel(isPresented: $isFlowPresented)
}
UIKIt
For UIKit, present the Flyreel flow on any UIViewController:
FlyreelSDK.shared.presentFlyreel(on: self)
Deep Linking
If you're launching the Flyreel flow from a deep link, push notification, or a custom solution where user details can be provided automatically, use:
SwiftUI
func presentFlyreel(
isPresented: Binding<Bool>,
zipCode: String,
accessCode: String,
shouldSkipLoginPage: Bool = true
)
func presentFlyreel(
isPresented: Binding<Bool>,
deepLinkURL: URL,
shouldSkipLoginPage: Bool = true
)
UIKit
func presentFlyreel(
on rootViewController: UIViewController,
zipCode: String,
accessCode: String,
shouldSkipLoginPage: Bool = true,
animated: Bool = true
)
func presentFlyreel(
on rootViewController: UIViewController,
deepLinkURL: URL,
shouldSkipLoginPage: Bool = true,
animated: Bool = true
)
Debug Logs
Enable debug logging for troubleshooting purposes:
FlyreelSDK.shared.enableLogs()
Sandbox
Verify your implementation in the sandbox mode. Switch the environment with the configuration:
let configuration = FlyreelConfiguration(
settingsVersion: "1",
organizationId: "7d3899f1421a7650241516475",
environment: .sandbox
)
FlyreelSDK.shared.set(configuration: configuration)