Interface BatchDeeplinkInterceptor


  • public interface BatchDeeplinkInterceptor
    Abstract class describing a deeplink interceptor. An interceptor's job is to override some aspects of a deeplink that Batch wants to open. See the various methods to see what you can override.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default android.content.Intent getFallbackIntent​(android.content.Context context)
      Called as a fallback when a previous task stack builder or intent could not be launched.
      android.content.Intent getIntent​(android.content.Context context, java.lang.String deeplink)
      Called when a deeplink is triggered by Batch (could be from a push notification or an in-app message).
      androidx.core.app.TaskStackBuilder getTaskStackBuilder​(android.content.Context context, java.lang.String deeplink)
      Called when a deeplink is triggered by Batch (only called from a push notification).
    • Method Detail

      • getFallbackIntent

        @Nullable
        default android.content.Intent getFallbackIntent​(@NonNull
                                                         android.content.Context context)
        Called as a fallback when a previous task stack builder or intent could not be launched. By default, use the PackageManager.getLaunchIntentForPackage(String) method to get an intent. If null is returned, the action is ignored.

        Recommended: use this method when you want to customise the default intent for your app. (not launching the LAUNCHER activity of your manifest for example)

        Parameters:
        context - The current context
        Returns:
        The intent to launch
      • getTaskStackBuilder

        @Nullable
        androidx.core.app.TaskStackBuilder getTaskStackBuilder​(@NonNull
                                                               android.content.Context context,
                                                               @NonNull
                                                               java.lang.String deeplink)
        Called when a deeplink is triggered by Batch (only called from a push notification). If null is returned getIntent(Context, String) will be used.

        Recommended: use this method when you want to add activities to the back stack when a push notification is clicked.

        Parameters:
        context - The current context
        deeplink - The deeplink associated with the action
        Returns:
        The task stack builder to launch
      • getIntent

        @Nullable
        android.content.Intent getIntent​(@NonNull
                                         android.content.Context context,
                                         @NonNull
                                         java.lang.String deeplink)
        Called when a deeplink is triggered by Batch (could be from a push notification or an in-app message). If null is returned the default behavior will be used.

        Recommended: use this method when you want to customise the intent for a deeplink when a CTA/push is clicked.

        Parameters:
        context - The current context
        deeplink - The deeplink associated with the action
        Returns:
        The intent to launch