Class IntentParser


  • public final class IntentParser
    extends java.lang.Object
    Intent parser to retrieve promo code and other data
    • Constructor Summary

      Constructors 
      Constructor Description
      IntentParser​(android.app.Activity activity)
      Init a parser with the intent of the activity
      IntentParser​(android.content.Intent intent)
      Init a parser with the given intent
    • Constructor Detail

      • IntentParser

        public IntentParser​(android.app.Activity activity)
        Init a parser with the intent of the activity
        Parameters:
        activity -
      • IntentParser

        public IntentParser​(android.content.Intent intent)
        Init a parser with the given intent
        Parameters:
        intent -
    • Method Detail

      • hasPushPayload

        public boolean hasPushPayload()
      • comesFromPush

        public boolean comesFromPush()
        Does this intent comes from a push notification
        Returns:
        true if it does
      • isOpenAlreadyTracked

        public boolean isOpenAlreadyTracked()
        Does the open has been already tracked
        Returns:
        true if it was
      • markOpenAsAlreadyTracked

        public void markOpenAsAlreadyTracked()
        Mark the open as already tracked
      • hasLanding

        public boolean hasLanding()
        Does this intent contains a Batch Messaging landing message
        Returns:
        true if it does
      • isLandingAlreadyShown

        public boolean isLandingAlreadyShown()
        Does the landing message has been already shown
        Returns:
        true if it was
      • markLandingAsAlreadyShown

        public void markLandingAsAlreadyShown()
        Mark the open as already tracked
      • getLanding

        @Nullable
        public BatchMessage getLanding()
        Get the landing message and mark it as used
        Returns:
        Batch Message to display
      • getPushId

        public java.lang.String getPushId()
        Retrieve the push identifier from the intent.
        Returns:
        the push identifier
      • getPushData

        public InternalPushData getPushData()
        Retrieve the push data from the intent.
        Returns:
        the push data
      • getPushBundle

        public android.os.Bundle getPushBundle()
      • putPushExtrasToIntent

        public static void putPushExtrasToIntent​(android.os.Bundle fullPayload,
                                                 InternalPushData batchData,
                                                 android.content.Intent launchIntent)
        Add push extras to an intent, to be picked up and tracked by Batch later
      • copyExtras

        public static void copyExtras​(@Nullable
                                      android.content.Intent from,
                                      @Nullable
                                      android.content.Intent to)
        Copy all of Batch's possible internal extras from an intent to another
      • copyExtras

        public static void copyExtras​(@Nullable
                                      android.os.Bundle from,
                                      @Nullable
                                      android.os.Bundle to)
        Copy all of Batch's possible internal extras from a bundle