Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ingresse/ios-sdk
Ingresse iOS SDK
https://github.com/ingresse/ios-sdk
ios mobile sdk
Last synced: 2 months ago
JSON representation
Ingresse iOS SDK
- Host: GitHub
- URL: https://github.com/ingresse/ios-sdk
- Owner: ingresse
- License: mit
- Created: 2016-12-08T16:50:22.000Z (about 8 years ago)
- Default Branch: dev
- Last Pushed: 2024-07-12T17:01:55.000Z (7 months ago)
- Last Synced: 2024-11-17T14:47:48.824Z (3 months ago)
- Topics: ios, mobile, sdk
- Language: Swift
- Size: 1.57 MB
- Stars: 1
- Watchers: 24
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Installation guide
Add this to your Podfile:
```ruby
pod 'IngresseSDK'
```Import SDK on your Swift class
```swift
import IngresseSDK
```## IngresseClient
### Passing device info to SDK:
This info is used to identify your app and user device for better and faster problem solving```swift
import Foundation
import UIKitclass UserAgent {
static func getUserAgent() -> String {
let currentDevice = UIDevice.current
let osDescriptor = "iOS/ \(currentDevice.systemVersion)"
let deviceModel = currentDevice.namelet deviceDescriptor = "\(osDescriptor) [\(deviceModel)]"
guard let bundleDict = Bundle(for: UserAgent.self).infoDictionary,
let appName = bundleDict["CFBundleName"] as? String,
let appVersion = bundleDict["CFBundleShortVersionString"] as? String
else { return deviceDescriptor }let appDescriptor = "\(appName)/\(appVersion)"
return "\(appDescriptor) \(deviceDescriptor)"
}
}
```### Create a SDK Manager to your app
```swift
import IngresseSDKclass MySDKManager {
static let shared = MySDKManager()var service: IngresseService!
init() {
let client = IngresseClient(
apiKey: "",
userAgent: UserAgent.getUserAgent(),
urlHost: "")self.service = IngresseService(client: client)
}
}
```## IngresseService
After creating your SDK Manager you can use it to access your IngresseService
```swift
let service = MySDKManager.shared.service
```You can use different types of service from IngresseService
### AuthService
Used to login and get user data
```swift
let authService = service.auth
authService.loginWithEmail("[email protected]", andPassword: "******", onSuccess: (Callback block), onError: (Callback block))
```### EntranceService
Used to make entrance related operations such as guest-list download and checkin
```swift
let entranceService = service.entrance
entranceService.getGuestListOfEvent("EVENT_ID", sessionId: "SESSION_ID", userToken: "REQUIRED_USER_TOKEN", page: 1, delegate: MyClass)
```