Giter Club home page Giter Club logo

blondie-flow-sdk-ios's Introduction

Blondie SDK

Get started on integrating the Blondie into your native iOS app through these guides:

Installation

Install Blondie to perform automations right from your iOS app. The Blondie SDK for iOS library supports iOS 8.x and upwards.

Step 1 - Install Blondie SDK

Before you start, you need to make sure you have an access to the Blondie. Then you have three options:

Option 1: CocoaPods (pending)

Add Blondie SDK to your Podfile and run pod install

target :YourTargetName do
  pod 'Blondie'
end

Option 2. Carthage (pending)

  1. Add github "blondie-inc/blondie-sdk-ios" to your Cartfile.
  2. Run carthage update.
  3. Go to your Xcode project's "General" settings. Drag Blondie.framework from Carthage/Build/iOS to the "Embedded Binaries" section.

Option 3: Install Blondie manually

Download Blondie SDK for iOS and extract the zip.

Go to your Xcode project's "General" settings. Drag Blondie.framework to the "Embedded Binaries" section. Make sure “Copy items if needed” is selected and click Finish.

Step 3 - Initialize Blondie

First, you'll need to get your Blondie Flow ID and an API key. To find these, just add an SDK trigger to your Blondie Flow.

Then initialize Blondie SDK by importing Library and adding the following to your application delegate:

Objective-C:

@import Blondie;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [Blondie setApiKey:@"<Your JWT API Key>"];
}

Swift:

import Blondie 
  
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
     Blondie.setApiKey("<Your JWT API Key>")
}

Configuration

Here’s how to configure Blondie for iOS:

Select an environment

You can select the Blondie Flow environment to use. It is very handy when you need to test a particular feature before rolling out to production.

By default we select production environment, but you can always change it by calling one of:

Objective-C:

[Blondie useDevelopmentEnvironment];
[Blondie useTestEnvironment];
[Blondie useProductionEnvironment];

Swift:

Blondie.useDevelopmentEnvironment()
Blondie.useTestEnvironment()
Blondie.useProductionEnvironment()

Use a custom Blondie Flow instance

In order to integrate Blondie SDK with a custom Blondie Flow instance you can set the base url by calling:

Objective-C:

[Blondie setBaseUrl:@"https://custom.flow.url"];

Swift:

Blondie.setBaseUrl("https://custom.flow.url")

Disable offline mode

By default Blondie SDK works both in both online and offline mode. In order to work without an internet connection, Blondie SDK keeps a queue of events to sync when the connection becomes available again.

You can disable that behaviour by calling:

Objective-C:

[Blondie disableOfflineMode];

Swift:

Blondie.disableOfflineMode()

Disable auto retries

By default Blondie SDK performs automatic retries if an error occurs during a request to the Blondie Flow, so that you don't need to worry about missing an event.

You can disable that behaviour by calling:

Objective-C:

[Blondie disableAutoRetries];

Swift:

Blondie.disableAutoRetries()

Tracking events

You can log events in Blondie that record what users do in your app and when they do it. For example, you could record the data a user submitted in your mobile app, and when they submitted it.

Objective-C:

[Blondie triggerEventWithName:@"Short Form Submitted" metaData: @{
  @"amount": @1234,
  @"customer": @{
    @"phone": @"+3712654321",
    @"email": @"[email protected]"
  }
}];

Swift:

Blondie.triggerEvent(
  withName: "Short Form Submitted", 
  metaData: [
    "amount": 1234,
    "customer": [
      "phone": "+3712654321",
      "email": "[email protected]"
    ]
  ]
)

blondie-flow-sdk-ios's People

Contributors

maximbilan avatar maximgladkov avatar

Watchers

James Cloos avatar  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.