HolaSDK 0.1.13

HolaSDK 0.1.13

Deploy Hola 维护。



HolaSDK 0.1.13

  • 作者
  • volodymyr

HolaSDK for iOS

集成

target 'MyApp' do
  pod 'HolaSDK'
end

使用

在使用前进行初始化

import HolaSDK

// initialize only once
HolaSDK.shared.login(as: "<customer>")

使用解除拦截器发送 HTTPS 请求

import HolaSDK

// create URLSession (multiple sessions allowed),
// URLSessionDelegate as a second parameter is optional
let configuration = URLSessionConfiguration.default
configuration.XXX = YYY
let myGlobalSession = HolaSDK.shared.createUnblockerSession(conf: configuration,
    delegate: self)

// use standard URLSession API to make requests
let url = URL("https://example.com/demo/path")!
let task = myGlobalSession.dataTask(with: url) { (data, resp, error) in
    let status = (resp as? HTTPURLResponse)?.statusCode ?? 0
    let count = data?.count ?? 0
    let err = String(describing: error)
    print("response from \(url): status \(status) data \(count)B error \(err)")
}
task.resume()