Class ActionModule


  • public class ActionModule
    extends BatchModule
    Batch's Action Module.
    • Field Detail

      • RESERVED_ACTION_IDENTIFIER_PREFIX

        public static final java.lang.String RESERVED_ACTION_IDENTIFIER_PREFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • ActionModule

        public ActionModule()
    • Method Detail

      • getAliasedDrawableID

        @DrawableRes
        public int getAliasedDrawableID​(@NonNull
                                        java.lang.String alias)
      • performUserAction

        public boolean performUserAction​(@Nullable
                                         android.content.Context context,
                                         @NonNull
                                         java.lang.String identifier,
                                         @Nullable
                                         JSONObject args)
        Perform the specified action. Meant for the public SDK
        Parameters:
        context - Context, if any
        identifier - Action identifier
        args - Action arguments in JSON form
        Returns:
        true if an action was registered for this identifier and performed, false otherwise.
      • performAction

        public boolean performAction​(@Nullable
                                     android.content.Context context,
                                     @NonNull
                                     java.lang.String identifier,
                                     @NonNull
                                     JSONObject args,
                                     @Nullable
                                     UserActionSource source)
        Perform the specified action. Meant for the private SDK
        Parameters:
        context - Context, if any
        identifier - Action identifier
        args - Action arguments in JSON form
        source - The action source
        Returns:
        true if an action was registered for this identifier and performed, false otherwise.
      • setDeeplinkInterceptor

        public void setDeeplinkInterceptor​(@Nullable
                                           BatchDeeplinkInterceptor interceptor)
        Get the developer registered deeplink interceptor
      • getDeeplinkInterceptor

        @Nullable
        public BatchDeeplinkInterceptor getDeeplinkInterceptor()
        Set the developer registered deeplink interceptor
      • getDrawableIdForNameOrAlias

        public int getDrawableIdForNameOrAlias​(@NonNull
                                               android.content.Context context,
                                               @Nullable
                                               java.lang.String drawableName)
      • getId

        public java.lang.String getId()
        Description copied from class: BatchModule
        ID of the module
        Specified by:
        getId in class BatchModule
        Returns:
      • getState

        public int getState()
        Description copied from class: BatchModule
        Should return the state of the module (usually 0 for deactivated, 1 for activated)
        Specified by:
        getState in class BatchModule
        Returns: