Enum Connect

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Connect>


    public enum Connect
    extends java.lang.Enum<Connect>
    Connect SDK public entry point. Use this object to initialise the Connect SDK.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      INSTANCE 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void disablePush()
      Disables push notifications for the currently active user.
      User getUser()
      Gets the currently active user
      void identifyUser(User user)
      Identify a Connect user.
      void init(Application application, java.lang.String privateKey)
      Initialise Connect SDK
      void logoutUser()
      Logs the currently active user out of the SDK by clearing their identity from local storage and disabling push notifications.
      void registerForPush()
      Registers the currently active user for push notifications.
      void trackEvent(Event event)
      Track a Connect event.
      static Connect valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Connect[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • INSTANCE

        public static final Connect INSTANCE
    • Method Detail

      • values

        public static Connect[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Connect c : Connect.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Connect valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • init

        public void init(Application application,
                         java.lang.String privateKey)

        Initialise Connect SDK

        Parameters:
        application - an instance of Application
        privateKey - a Connect private API key
      • identifyUser

        public void identifyUser(User user)

        Identify a Connect user. Use UserBuilder to construct a User object with all of the details required. For an anonymous user you can use UserBuilder.anonymousUser().

        Identify should be called when a user needs to be remembered, or the existing information for a user needs to be updated.

        Parameters:
        user - the User to be identified
      • trackEvent

        public void trackEvent(Event event)

        Track a Connect event. Use EventFactory to quickly create Event objects.

        Track should be called whenever something important happens that you want to monitor in your Connect dashboard.

        Parameters:
        event - the Event to be tracked
      • registerForPush

        public void registerForPush()

        Registers the currently active user for push notifications.

      • disablePush

        public void disablePush()

        Disables push notifications for the currently active user.

      • logoutUser

        public void logoutUser()

        Logs the currently active user out of the SDK by clearing their identity from local storage and disabling push notifications.

      • getUser

        public User getUser()

        Gets the currently active user

        Returns:
        the currently active User, or null if the user does not exist or Connect has not been initialised