Classes

The following classes are available globally.

Login Flow Builder

  • The class capable of building Login Flows

    • Building is always possible via a build call, provided that all the parameters which a Login Flow should know are provided before the build call is done
    • It can be provided a parameter via a set call
    • When a partcular Login flow is built, if one or more parameters are missing the build throw an exception
    • If a build is successful you can create even more copies of the same login flow, and everyone of them will be ready to be started, even if the builder object dies and is recycled from the memory

    Precondition

    user is not already logged and there aren’t any current running Login Flow at the moment

    Example of usage:

       do {
            let builder = try Newton.getSharedInstance()
                .getLoginBuilder()
                .setCustomData(cData: NWSimpleObject(fromDictionary: ["aString": "aValue"])!)
                .setOnFlowCompleteCallback { error in
                    DispatchQueue.main.async { () -> Void in
                        if let error = error {
                            print("Login Flow completed with Error: \(error)")
                        } else {
                            print("Login Flow went well")
                        }
                    }
                }
    
            let oAuthFlow = try builder.getOAuthLoginFlow()
            oAuthFlow.startLoginFlow()
        } catch NWError.NewtonNotInitialized(let reason) {
            print("Newton not initialized: \(reason)")
        } catch NWError.NewtonError(code: NWError.LoginBuilderError, message: let reason, statusCode: _, error: _, extra: _) {
            print("Login builder Error: \(reason)")
        } catch {
            print("Unknown Error: \(error)")
        }
    
    See more

    Declaration

    Swift

    public class NWLoginBuilder
  • Base class for all login flow

    Warning

    you cannot instantiate a NWLoginFlowBase class directly
    See more

    Declaration

    Swift

    public class NWLoginFlowBase
  • The Class used to perform Custom Login in legacy applications

    See more

    Declaration

    Swift

    public class NWCustomLoginFlow : NWLoginFlowBase, NWLoginFlow
  • The class representing the OAuth provider that is used in the Login Flow

    See more

    Declaration

    Swift

    public class OAuthProvider : NSObject
  • The object used to perform OAuth login

    See more

    Declaration

    Swift

    public class NWOAuthLoginFlow : NWLoginFlowBase, NWLoginFlow
  • Undocumented

    See more

    Declaration

    Swift

    public class NWEmailPasswordLoginFlow : NWLoginFlowBase, NWLoginFlow
  • Undocumented

    See more

    Declaration

    Swift

    public class NWEmailForgotFlow : NWLoginFlowBase, NWLoginFlow
  • Undocumented

    See more

    Declaration

    Swift

    public class NWEmailResendFlow : NWLoginFlowBase, NWLoginFlow
  • Undocumented

    See more

    Declaration

    Swift

    public class NWEmailSignupLoginFlow : NWLoginFlowBase, NWLoginFlow
  • The object used to perform MSISDN Login with number and PIN

    See more

    Declaration

    Swift

    public class NWMSISDNPINLoginFlow : NWLoginFlowBase, NWLoginFlow, NWForgotFlow
  • The object used to perform MSISDN Login with user’s number recognition

    See more

    Declaration

    Swift

    public class NWMSISDNUserRecognitionLoginFlow : NWLoginFlowBase, NWLoginFlow
  • The object used to perform External Login

    See more

    Declaration

    Swift

    public class NWExternalLoginFlow : NWLoginFlowBase, NWLoginFlow
  • Undocumented

    See more

    Declaration

    Swift

    public class NWPaymentReceiptLoginFlow : NWLoginFlowBase, NWLoginFlow
  • Undocumented

    See more

    Declaration

    Swift

    public class NWMFPLoginFlow : NWLoginFlowBase, NWLoginFlow
  • The object used to perform a UO2 Login

    See more

    Declaration

    Swift

    public class NWUO2CredentialsLoginFlow : NWLoginFlowBase, NWLoginFlow
  • Undocumented

    See more

    Declaration

    Swift

    public class NWPaymentObject : Printable
  • Undocumented

    See more

    Declaration

    Swift

    public class NWPaymentManager
  • The Factory of NWPushBase objects to be built locally

    See more

    Declaration

    Swift

    public class NWPushBuilder
  • The Object who manages all the interactions with Push Notifications, from APNS to PushNotification messages

    See more

    Declaration

    Swift

    public class NWPushManager
  • The object describing the Push received

    See more

    Declaration

    Swift

    public class NWPushBase : NSObject, NWStorable
  • Standard Push Notification is the common Push sent by the server

    See more

    Declaration

    Swift

    public class NWStandardPush : NWPushBase
  • Url push notification is a special kind of push that redirects the user on a URL

    See more

    Declaration

    Swift

    public class NWUrlPush : NWStandardPush
  • A simple aggregate of key:value, not nested, used mainly in Analytic events.

    Important

    The value types a simple Object can carry are limited to String, Int, Float, Double, Bool, Null

    Attention

    There are limits to the memory that a Simple Object can occupy. Moreover Strings value cannot be more than 512 characters each.
    See more

    Declaration

    Swift

    public class NWSimpleObject : NSObject, NSCoding
  • The class representing the User Meta Information Meta information are such as the way the user is logged in, the provider and so on.

    Warning

    This information is temporary and should be asked as soon as possible after a login procedure
    See more

    Declaration

    Swift

    public class NWUserMetaInfo : NSObject, NWStorable, Expirable