MyGaruSDK 0.2.1

MyGaruSDK 0.2.1

Maintained by Oleg Agapov.



 
Depends on:
RxSwift~> 4.4
RxCocoa~> 4.4
RxOptional~> 3.6
Alamofire~> 4.8
AlamofireImage~> 3.5
Moya~> 12.0
Moya/RxSwift>= 0
ObjectMapper~> 3.4
Moya-ObjectMapper~> 2.8
Moya-ObjectMapper/RxSwift>= 0
KeychainSwift~> 13.0
Starscream~> 3.1
TTTAttributedLabel>= 0
 

MyGaruSDK 0.2.1

  • By
  • Oleg Agapov

MyGaruSDK

CI Status Version License Platform

Warning

!! This SDK is not considered ready for production use.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

MyGaruSDK compatible with both Swift and Objective-C. You will need Swift 5.0+ and Xcode 10.2+

Getting API Key

First, you'll need to get your myGaruSDK iOS API key. To find these, just contact our team [email protected] .

Installation

MyGaruSDK is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MyGaruSDK'

Initialization

For every file that are using MyGaruSDK, add:

import MyGaruSDK

Then, initialize MyGaruSDK by adding the following to your AppDelegate class:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    MyGaruSDK.initialization(apiKey: "YOUR_API_KEY", appIdentifier: "APP_BUNDLE_ID")
}

Usage

To take advantage of MyGaruSDK functionality, your user must login first into MyGaru. For this, present login flow use following code:

do {
    let myGaruVC = try MyGaruSDK.showDashboard()
    self.present(myGaruVC, animated: true, completion: nil)
} catch (let error) {
    print("Couldn't start an SDK: \(error)")
}

To send data to MyGaru, use following:

do {
    let parameters = ["lucky_number": 42]
    try MyGaruSDK.sendData(description: "Test Collection", parameters: parameters) { (result: Bool) in
        result ? print("YAY!") : print("NOOO!")
    }
} catch (let error) {
    print("Couldn't send data: \(error)")
}

See Example project for more information.

Author

myGaru Technologies, Oleg Agapov, [email protected]

License

MyGaruSDK is available under the Apache License, Version 2.0. See the LICENSE file for more info.