Classes

The following classes are available globally.

  • Newton iOS SDK v2.3.0 Copyright © 2018 Buongiorno S.p.A. All rights reserved.

    See more

    Declaration

    Swift

    public final class Newton : NSObject
  • The scope where the recommendation of a content takes place

    See more

    Declaration

    Swift

    public class RankingScope : NSObject
  • 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.LoginBuilderError(let reason) {
            print("Login builder Error: \(reason)")
        } catch {
            print("Unknown Error: \(error)")
        }
    
    See more

    Declaration

    Swift

    public class NWLoginBuilder
  • 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
  • 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