Package 

Class Branch.InitSessionBuilder

    • Method Detail

      • withCallback

         Branch.InitSessionBuilder withCallback(Branch.BranchUniversalReferralInitListener callback)

        Add callback to Branch initialization to retrieve referring params attached to theBranch link via the dashboard. User eventually decides how to use the referring params butthey are primarily meant to be used for navigating to specific content within the app.Use only one withCallback() method.

        Parameters:
        callback - A BranchUniversalReferralInitListener instance that will be calledfollowing successful (or unsuccessful) initialisation of the sessionwith the Branch API.
      • withDelay

         Branch.InitSessionBuilder withDelay(int delayMillis)

        Delay session initialization by certain time (used when other async or otherwise timeconsuming ops need to be completed prior to session initialization).

        Parameters:
        delayMillis - An Integer indicating the length of the delay in milliseconds.
      • withCallback

         Branch.InitSessionBuilder withCallback(Branch.BranchReferralInitListener callback)

        Add callback to Branch initialization to retrieve referring params attached to theBranch link via the dashboard. User eventually decides how to use the referring params butthey are primarily meant to be used for navigating to specific content within the app.Use only one withCallback() method.

        Parameters:
        callback - A BranchReferralInitListener instance that will be calledfollowing successful (or unsuccessful) initialisation of the sessionwith the Branch API.
      • ignoreIntent

         Branch.InitSessionBuilder ignoreIntent(boolean ignore)

        Use this method cautiously, it is meant to enable the ability to start a session beforethe user even opens the app.The use case explained:Users are expected to initialize session from Activity.onStart. However, by default, Branch actuallywaits until Activity.onResume to start session initialization, so as to ensure that the latest intentdata is available (e.g. when activity is launched from stack via onNewIntent). Setting this flag to truewill bypass waiting for intent, so session could technically be initialized from a background serviceor otherwise before the application is even opened.Note however that if the flag is not reset during normal app boot up, the SDK behavior is undefinedin certain cases. See also Branch.bypassWaitingForIntent(boolean).

        Parameters:
        ignore - a Boolean indicating if SDK should wait for onResume to retrievethe most up recent intent data before firing the session initialization request.
      • init

         void init()

        Initialises a session with the Branch API, registers the passed in Activity, callbackand configuration variables, then initializes session.

      • reInit

         void reInit()

        Re-Initialize a session. Call from Activity.onNewIntent().This solves a very specific use case, whereas the app is already in the foreground and a newintent with a Uri is delivered to the foregrounded activity.Note that the Uri can also be stored as an extra in the field under the key `IntentKeys.BranchURI.getKey()` (i.e. "branch").Note also, that the since the method is expected to be called from Activity.onNewIntent(),the implementation assumes the intent will be non-null and will contain a Branch link ineither the URI or in the the extra.