DALIapi
public class DALIapi
Static class to configure and handle general requests for the DALI api framework
-
The current configuration being used by the framework
Declaration
Swift
public static var config: DALIConfig { get } -
Defines if the user is signed in
Declaration
Swift
public static var isSignedIn: Bool { get } -
A callback reporting either success or failure in the requested action
Declaration
Swift
public typealias SuccessCallback = (_ success: Bool, _ error: DALIError.General?) -> VoidParameters
successFlag indicating success in the action
errorError encountered (if any)
-
Configures the entire framework
NOTE: Make sure to run this configure method before using anything on the API
Declaration
Swift
public static func configure(config: DALIConfig) -
Enables the use of sockets
Declaration
Swift
public static func enableSockets() -
Disables all sockets used by the API
Declaration
Swift
public static func disableSockets() -
Signs in on the server using Google Signin provided server auth code
Declaration
Swift
public static func signin(authCode: String, done: @escaping (_ success: Bool, _ error: DALIError.General?) -> Void)Parameters
authCodeThe authCode provided by Google signin
doneFunction called when signin is complete
successThe signin completed correctly
errorThe error, if any, encountered
-
Signs in on the server using access and refresh tokens provided by Google Signin. Will not sign in if already signed in
Declaration
Swift
public static func signin(accessToken: String, refreshToken: String, done: @escaping (_ success: Bool, _ error: DALIError.General?) -> Void)Parameters
accessTokenThe access token provided by Google signin
refreshTokenThe refresh token from Google siginin
doneFunction called when signin is complete
successThe signin completed correctly
errorThe error, if any, encountered
-
Signs in on the server using access and refresh tokens provided by Google Signin
Declaration
Swift
public static func signin(accessToken: String, refreshToken: String, forced: Bool, done: @escaping (_ success: Bool, _ error: DALIError.General?) -> Void)Parameters
accessTokenThe access token provided by Google signin
refreshTokenThe refresh token from Google siginin
forcedFlag forces signin even if there is already a token avialable
doneFunction called when signin is complete
successThe signin completed correctly
errorThe error, if any, encountered
-
Silently updates the current member object from the server
Declaration
Swift
public static func silentMemberUpdate(callback: @escaping (_ member: DALIMember?) -> Void)Parameters
callbackA function to be called when the opperation is complete
memberThe updated memeber object
-
Signs out of your account on the API
Declaration
Swift
public static func signOut() -
Sends a notification to EVERY device with the given tag set to true
Declaration
Swift
public static func sendSimpleNotification(with title: String, and subtitle: String, to tag: String, callback: @escaping (_ success: Bool, _ error: DALIError.General?) -> Void)Parameters
titleThe title of the notification
subtitleThe main message to be sent
tagThe tag that OneSignal will use to identify recipient devices
callbackThe function that iwll be called when the process is done
successThe notification was sent correctly
errorThe error, if any, encountered
View on GitHub
DALIapi Class Reference