iOS
Installation​
- CocoaPods
- Swift Package Manager
- Carthage
Add to your Podfile
pod 'AirSnap'
Then run
$ pod install
Add to your Package.swift
import PackageDescription
let package = Package(
dependencies: [
.Package(url: "https://github.com/airsnapio/airsnap-ios")
]
)
Unfortunately we do not support Carthage at the moment. 😢
Please create an issue if you'd like to see support here.
Usage​
- Swift
- Objective-C
AppDelegate.swift
import AirSnapSDK
func application(...) -> Bool {
...
AirSnap.start(withAppKey: "<api-key>", privacyRule: .mask) // .mask or .unmask
AirSnap.setUser(id: "user@example.com")
}
AppDelegate.m
#import <AirSnapSDK/AirSnapSDK-Swift.h>
- (BOOL)application:... {
...
[AirSnap startWithAppKey:@"<api-key>" privacyRule:PrivacyRuleUnmask]; // PrivacyRuleUnmask or PrivacyRuleMask
[AirSnap setUserWithId:@"user@example.com"]
}