NWIdentityBuilder
public class NWIdentityBuilder
Undocumented
-
// Set the email address
Declaration
Swift
public func setEmail(email: String) -> NWIdentityBuilderParameters
emailthe String of the email address
Return Value
the Builder itself for chaining purposes
-
// Set the password
Declaration
Swift
public func setPassword(password: String) -> NWIdentityBuilderParameters
passwordthe password String (at least 1 character)
Return Value
the Builder itself for chaining purposes
-
// Set the product email params
Declaration
Swift
public func setProductEmailParams(params: NWSimpleObject) -> NWIdentityBuilderParameters
paramsNWSimpleObject
Return Value
the Builder itself for chaining purposes
-
// Set the password
Declaration
Swift
public func setSMSTemplate(smsTemplate: String) -> NWIdentityBuilderParameters
passwordthe password String (at least 1 character)
Return Value
the Builder itself for chaining purposes
-
Set the global callback to be informed when the Identity flow built has finished
Declaration
Swift
public func setOnFlowCompleteCallback(callback: @escaping FlowCompleteCallback) -> NWIdentityBuilderParameters
callbackFlowCompleteCallback callback
Return Value
the Builder itself for chaining purposes
-
Build a Email Identity Flow object
Example of Email Password Login flow:
do { let builder = try Newton.getSharedInstance() .getIdentityManager() .getIdentityBuilder() .setEmail(email: "pippo@gmail.com") .setPassword(pin: "1234") let flow = try addEmailIdentityFlow() } catch NWError.NewtonNotInitialized(let reason) { print("Newton not initialized: \(reason)") } catch NWError.IdentityBuilderError(let reason) { print("Login builder Error: \(reason)") } catch { print("Unknown Error: \(error)") }Warning
A check if there aren’t any other login flow in progress is madeWarning
The User must be not already logged in
Throws
IdentityBuilderError if IdentityFlow requirements are not met
Precondition
the EMAIL and Password have been set
Declaration
Swift
public func getAddEmailIdentityFlow() throws -> NWAddEmailIdentityFlowReturn Value
the EmailIdentityFlow object built
NWIdentityBuilder Class Reference