GigyaCore
public final class GigyaCore<T> : GigyaInstanceProtocol where T : GigyaAccountProtocol
The GigyaCore is the main interface for the SDK instance.
Provides all access to Gigya services.
When you use Gigya.sharedInstance() it will return an instance of GigyaCore.
Warning
GigyaCore is designed to use a custom generic schema type (Default: GigyaAccount). If you are instantiating the core using your own schema (Example: Gigya.sharedInstance(CustomSchema.self)) it is required to add the specific schema every time you call to Gigya.sharedInstance().
-
Declaration
Swift
public let config: GigyaConfig
-
Biometric service (TouchID / FaceID).
Declaration
Swift
public let biometric: BiometricServiceProtocolReturn Value
BiometricServiceProtocolservice
-
Initialize the SDK.
Declaration
Swift
public func initFor(apiKey: String, apiDomain: String? = nil)Parameters
apiKeyClient API-KEY
apiDomainRequest Domain.
-
Send request to Gigya servers.
Declaration
Swift
public func send(api: String, params: [String: Any] = [:], completion: @escaping (GigyaApiResult<GigyaDictionary>) -> Void )Parameters
apiMethod identifier.
paramsAdditional parameters.
completionResponse
GigyaApiResult<GigyaDictionary>. -
Send request with generic type.
Declaration
Swift
public func send<B: Codable>(dataType: B.Type, api: String, params: [String: Any] = [:], completion: @escaping (GigyaApiResult<B>) -> Void )Parameters
apiMethod identifier.
paramsAdditional parameters.
completionResponse
GigyaApiResult<T>.
-
Check if the current session is valid which us adjacent to login status.
Declaration
Swift
public func isLoggedIn() -> Bool -
Logout of Gigya services.
Declaration
Swift
public func logout(completion: @escaping (GigyaApiResult<GigyaDictionary>) -> Void)Parameters
completionResponse
GigyaApiResult<GigyaDictionary>.
-
Login api
Declaration
Swift
public func login(loginId: String, password: String, params: [String: Any] = [:], completion: @escaping (GigyaLoginResult<T>) -> Void)Parameters
loginIduser identity.
passworduser password.
paramsRequest parameters.
completionResponse
GigyaLoginResult<T>. -
Login with a 3rd party provider.
Declaration
Swift
public func login(with provider: GigyaSocialProviders, viewController: UIViewController, params: [String: Any] = [:], completion: @escaping (GigyaLoginResult<T>) -> Void)Parameters
providerSocial provider.
viewControllerShown view controller.
paramsRequest parameters.
completionResponse
GigyaLoginResult<T>. -
Register account using email and password combination
Declaration
Swift
public func register(email: String, password: String, params: [String: Any], completion: @escaping (GigyaLoginResult<T>) -> Void)Parameters
emailuser email.
passworduser password.
paramsRequest parameters.
completionResponse
GigyaLoginResult<T>. -
Request account info.
Declaration
Swift
public func getAccount(_ clearAccount: Bool = false, completion: @escaping (GigyaApiResult<T>) -> Void)Parameters
clearAccountset true when you want to clear cache.
completionResponse
GigyaApiResult<T>. -
Set account info.
Declaration
Swift
public func setAccount(with account: T, completion: @escaping (GigyaApiResult<T>) -> Void)Parameters
accountSchema type.
completionResponse
GigyaApiResult<T>.
-
Present social login selection list.
Declaration
Swift
public func socialLoginWith(providers: [GigyaSocialProviders], viewController: UIViewController, params: [String: Any], completion: @escaping (GigyaLoginResult<T>) -> Void)Parameters
providersList of selected social providers (
GigyaSocielProviders).viewControllerShown view controller.
paramsRequest parameters.
completionLogin response
GigyaLoginResult<T>. -
Add a social connection to current account.
Declaration
Swift
public func addConnection(provider: GigyaSocialProviders, viewController: UIViewController, params: [String: Any], completion: @escaping (GigyaApiResult<T>) -> Void)Parameters
providersselected social provider (GigyaSocielProviders).
viewControllerShown view controller.
paramsRequest parameters.
completionLogin response
GigyaApiResult<T>. -
Remove a social connection from current account.
Declaration
Swift
public func removeConnection(provider: GigyaSocialProviders, completion: @escaping (GigyaApiResult<GigyaDictionary>) -> Void)Parameters
providersselected social provider name.
completionLogin response
GigyaApiResult<GigyaDictionary>.
-
Show ScreenSet
Declaration
Swift
public func showScreenSet(with name: String, viewController: UIViewController, params: [String: Any] = [:], completion: @escaping (GigyaPluginEvent<T>) -> Void)Parameters
nameScreenSet name.
viewControllerShown view controller.
paramsGeneral ScreenSet parameters.
completionPlugin completion
GigyaPluginEvent<T>.
-
Return SDK interruptions state. if TRUE, interruption handling will be optional via the GigyaLoginCallback.
Declaration
Swift
public var interruptionsEnabled: Bool { get } -
Update interruption handling. By default, the Gigya SDK will handle various API interruptions to allow simple resolving of certain common errors. Setting interruptions to FALSE will force the end user to handle his own errors.
Declaration
Swift
public func handleInterruptions(sdkHandles: Bool)Parameters
sdkHandlesFalse if manually handling all errors.
-
Create an new instance of the GigyaWebBridge.
Declaration
Swift
public func createWebBridge() -> GigyaWebBridge<T>Return Value
GigyaWebBridgeinstance.
GigyaCore Class Reference