NSKApi
The NearspeakKit API communication class.
-
The api authentication token.
Declaration
Swift
public var auth_token: String? -
Init the API object.
Declaration
Swift
public init(devMode: Bool)Parameters
devModeConnect to the staging oder production server.
-
Remove the server credentials from the local device.
Declaration
Swift
public func logout() -
Save the server credentials to the local device.
Declaration
Swift
public func saveCredentials() -
Load the server credentials from the local device.
Declaration
Swift
public func loadCredentials() -
Check if the current user is logged in.
Declaration
Swift
public func isLoggedIn() -> Bool
-
API call to get the authentication token from the API server.
Declaration
Swift
public func getAuthToken(#username: String, password : String, requestCompleted: (succeeded: Bool, auth_token: String) -> ())Parameters
username:The username of the user.
password:The password of the user.
requestCompletedThe request completion block.
-
API call to get all Nearspeak tag from the user.
Declaration
Swift
public func getMyTags(requestCompleted: (succeeded: Bool, tags: [NSKTag]) ->())Parameters
requestCompletedThe request completion block.
-
API call to get a Nearspeak tag by its tag identifier.
Declaration
Swift
public func getTagById(#tagIdentifier: String, requestCompleted: (succeeded: Bool, tag: NSKTag?) -> ())Parameters
tagIdentifierThe tag identifier of the tag.
requestCompletedThe request completion block.
-
API call to get a Nearspeak tag by its hardware identifier.
Declaration
Swift
public func getTagByHardwareId(#hardwareIdentifier: String, beaconMajorId: String, beaconMinorId: String, requestCompleted: (succeeded: Bool, tag: NSKTag?) -> ())Parameters
hardwareIdentifierThe hardware identifier of the tag.
beaconMajorIdThe iBeacon major id.
beaconMinorIdThe iBeacon minor id.
requestCompletedThe request completion block.
-
API call to get all supported iBeacon UUIDs.
Declaration
Swift
public func getSupportedBeaconsUUIDs(requestCompleted: (succeeded: Bool, uuids: [String]) ->())Parameters
requestCompletedThe request completion block.
View on GitHub
NSKApi Class Reference