Git Product home page Git Product logo

flyreel-sdk-react-native's Introduction

Flyreel React SDK

Platform Platform Languages Releases

Requirements:

Android

  • Android 6+ (minSdk 23)

iOS

  • iOS 13+

Installation

$ npm install --save @flyreel/flyreel-sdk-react-native
# --- or ---
$ yarn add @flyreel/flyreel-sdk-react-native

Don't forget to run pod install after that !

Usage

Permissions on iOS

Since the SDK actively uses some functionalities of the iOS system you need to provide a few permission settings in your Info.plist file.

<dict>
    // ...
    <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>
</dict>

Importing

To use the Flyreel SDK, import it into your javascript or typescript files like so:

import Flyreel from 'flyreel-sdk-react-native'

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.

In your App.tsx file, initialize Flyreel using provided object:

// initialize Flyreel with organizationId and settingsVersion
await Flyreel.initialize('5d3633f9103a930011996475', 1);

How to open Flyreel chat

Invoke openFlyreel()

Flyreel.open();

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:

// open with flyreelZipCode and flyreelAccessCode parameters
Flyreel.openWithCredentials('80212', '6M4T0T', true);

// open with deeplink url with flyreelAccessCode and flyreelZipCode parameters
Flyreel.openWithDeeplink('https://your.custom.url/?flyreelAccessCode=6M4T0T&flyreelZipCode=8021', true);

Note

Last parameter determines whether you want to skip login page and login automatically.

Custom fonts

If you want to use a custom font for Flyreel chat, you have to provide a ttf file to both iOS and Android Platform.

  • in the Android directory, you can put the ttf file in the main/assets folder or the main/res/font folder.
  • for iOS, you have to go with the Apple instruction to add a custom font to your project.

Then, you can use the font's name in the Flyreel dashboard panel. For example, if you have added font my_font.ttf to the assets folder, you can use my_font as a font name in the Flyreel dashboard.

Debug Logs

Enable debug logging for troubleshooting purposes:

Flyreel.enableLogs();

Sandbox

Verify your implementation in the sandbox mode. Initialize Flyreel with sandbox environment:

await Flyreel.initializeWithSandbox('5d3633f9103a930011996475', 1);

flyreel-sdk-react-native's People

Contributors

pawellugowski avatar ajp-sourceship avatar

Stargazers

Zack Nolette avatar Josh Martin avatar

Watchers

Cole Winans avatar Brian Keller avatar Brian Webb avatar Scarlett Michanco avatar Zack Nolette avatar  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.