MyGaruSDK 0.2.1

MyGaruSDK 0.2.1

Oleg Agapov 维护。



 
依赖项
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

  • 作者
  • Oleg Agapov

MyGaruSDK

CI Status Version License Platform

警告

!! 此 SDK 还未准备用于生产使用。

实例

为了运行实例项目,请克隆仓库,然后首先从 Example 目录运行 pod install 命令。

要求

MyGaruSDK 与 Swift 和 Objective-C 都兼容。您将需要 Swift 5.0+ 和 Xcode 10.2+

获取 API 密钥

首先,您需要获取myGaruSDK的iOS API密钥。要找到这些,只需联系我们的团队[email protected]

安装

MyGaruSDK可通过CocoaPods获取。要安装它,只需将以下行添加到您的Podfile中

pod 'MyGaruSDK'

初始化

对于每个使用MyGaruSDK的文件,添加

import MyGaruSDK

然后,通过在AppDelegate类中添加以下代码来初始化MyGaruSDK

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

用法

要利用MyGaruSDK的功能,用户必须首先登录MyGaru。为此,使用以下代码呈现登录流程

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

要发送数据到MyGaru,使用以下

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)")
}

有关更多信息,请参阅示例项目。

作者

myGaru Technologies,Oleg Agapov,[email protected]

许可

MyGaruSDK遵循Apache License 2.0授权。有关更多信息,请参阅LICENSE文件。