Code Monkey home page Code Monkey logo

sugo-swift-sdk's Introduction

sugo-swift-sdk

Build Status CocoaPods Compatible Apache License

Introduction

Welcome to the official Sugo Swift SDK

The Sugo Swift SDK for iOS is an open source project, and we'd love to see your contributions!

Current supported features

**Our master branch and our 1.x.x-Releases are now in Swift 3.

Feature Swift 3
Tracking API
Documentation
Codeless Tracking

Installation

CocoaPods

Our current release only supports Cocoapods version 1.1.0+

Sugo supports CocoaPods for easy installation.

pod 'sugo-swift-sdk'

Manual Installation

To help users stay up to date with the latests version of our Swift SDK, we always recommend integrating our SDK via CocoaPods, which simplifies version updates and dependency management. However, there are cases where users can't use CocoaPods. Not to worry, just follow these manual installation steps and you'll be all set.

Step 1: Add as a Submodule

Add Sugo as a submodule to your local git repo like so:

git submodule add [email protected]:Datafruit/sugo-swift-sdk.git

Now the Sugo project and its files should be in your project folder!

Step 2: Drag Sugo to your project

Drag the Sugo.xcodeproj inside your sample project under the main sample project file:

Step 3: Embed the framework

Select your app .xcodeproj file. Under "General", add the Sugo framework as an embedded binary:

Step 4: Integrate!

Import Sugo into AppDelegate.swift, and initialize Sugo within application:didFinishLaunchingWithOptions:

func application(_ application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    let id: String = "Add_Your_Project_ID_Here"
    let token: String = "Add_Your_App_Token_Here"
    Sugo.initialize(id: id, token: token)
}

Initializing and Usage

By calling:

let sugo = Sugo.initialize(id: "Project_ID", token: "App_Token")

You initialize your sugo instance with the token provided to you on sugo.com. To interact with the instance and start tracking, you can either use the sugo instance given when initializing:

let sugo = Sugo.mainInstance()
sugo.track(eventName: "Tracked Event!")

or you can directly fetch the instance and use it from the Sugo object:

Sugo.mainInstance().track(eventName: "Tracked Event!")

Start tracking

You're done! You've successfully integrated the Sugo Swift SDK into your app. To stay up to speed on important SDK releases and updates, star or watch our repository on Github.

Have any questions? Reach out to [email protected] to speak to someone smart, quickly.

sugo-swift-sdk's People

Contributors

lzackx avatar

Watchers

Carabineiro 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.