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
devMode
Connect 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.
requestCompleted
The request completion block.
-
API call to get all Nearspeak tag from the user.
Declaration
Swift
public func getMyTags(requestCompleted: (succeeded: Bool, tags: [NSKTag]) ->())
Parameters
requestCompleted
The 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
tagIdentifier
The tag identifier of the tag.
requestCompleted
The 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
hardwareIdentifier
The hardware identifier of the tag.
beaconMajorId
The iBeacon major id.
beaconMinorId
The iBeacon minor id.
requestCompleted
The request completion block.
-
API call to get all supported iBeacon UUIDs.
Declaration
Swift
public func getSupportedBeaconsUUIDs(requestCompleted: (succeeded: Bool, uuids: [String]) ->())
Parameters
requestCompleted
The request completion block.