RequestSentinel-swift 0.1.0

RequestSentinel-swift 0.1.0

Umar Nizamani 维护。



  • Umar Nizamani

Request Sentinel - iOS SDK

iOS SDK for RequestSentinel

安装选项 1:Swift 包管理器 (v2.8.0+)

将 RequestSentinel 添加到您的 iOS 项目的最简单方法是通过 Swift 包管理器。

  1. 在 Xcode 中,选择 File > Add Packages...
  2. 输入此存储库的包 URL request-sentinel-swift

安装选项 2:CocoaPods

  1. 如果是您第一次使用 CocoaPods,请使用 gem install cocoapods 安装 CocoaPods。否则,继续到步骤 3。
  2. 运行 pod setup 以创建本地 CocoaPods 规范镜像。
  3. 在您的终端中运行 pod init 以在您的 Xcode 项目目录中创建一个 Podfile,编辑生成的 Podfile,并添加以下行: pod 'request-sentinel-swift'
  4. 在您的 Xcode 项目目录中运行 pod install。CocoaPods 应该下载并安装 RequestSentinel 库,并创建一个新的 Xcode 工作区。在 Xcode 中打开此工作区或在终端中键入 open *.xcworkspace

设置

import RequestSentinel

class AppDelegate: NSObject, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        ....

        RequestSentinel.shared.initialize(apiKey: "<API_KEY>",
                                          appVersion: "<YOUR_APP_VERSION>",
                                          appEnvironment: "<YOUR_APP_ENVIRONMENT>")
       
        ....
    }
}