Coder Social home page Coder Social logo

flyreel-sdk-ios's Introduction

Flyreel SDK

Swift 5.7 Supported iOS 13

Installation

Cocoapods

Add pod Flyreel to your Podfile

pod 'Flyreel'

Swift Package Manager

  1. Follow the Apple guide to add the package dependency to your app.
  2. 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()

Flyreel status check

You can manually check Flyreel status

///This function makes a network request to retrieve the status of Flyreel for the specified zip code and access code
func fetchFlyreelStatus(zipCode: String, accessCode: String, completion: @escaping (Result<FlyreelStatus, FlyreelError>) -> Void)

// or async version 
func fetchFlyreelStatus(zipCode: String, accessCode: String) async throws -> FlyreelStatus

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)

Firewall whitelisting

Here is a list of Flyreel's hosts in case you need to whitelist URLs.

api3.flyreel.co
sandbox.api3.flyreel.co

flyreel-sdk-ios's People

Contributors

szymonwojcikcrustlab avatar brianwebb22 avatar richard-a-lee avatar jmartin6716 avatar

Stargazers

Zack Nolette avatar

Watchers

Cole Winans avatar Brian Keller avatar  avatar Scarlett Michanco avatar AJ Patatanian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.