Skip to content

hola/hola-ios-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

HolaSDK for iOS

Integration

target 'MyApp' do
  pod 'HolaSDK'
end

Usage

Initialize before usage

import HolaSDK

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

Use unblocker to send HTTPS requests

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()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published