Package com.batch.android.module
Class ActionModule
- java.lang.Object
-
- com.batch.android.module.BatchModule
-
- com.batch.android.module.ActionModule
-
public class ActionModule extends BatchModule
Batch's Action Module.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringRESERVED_ACTION_IDENTIFIER_PREFIXstatic java.lang.StringTAG
-
Constructor Summary
Constructors Constructor Description ActionModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDrawableAlias(java.lang.String alias, int drawableResID)intgetAliasedDrawableID(java.lang.String alias)BatchDeeplinkInterceptorgetDeeplinkInterceptor()Set the developer registered deeplink interceptorintgetDrawableIdForNameOrAlias(android.content.Context context, java.lang.String drawableName)java.lang.StringgetId()ID of the moduleintgetState()Should return the state of the module (usually 0 for deactivated, 1 for activated)booleanperformAction(android.content.Context context, java.lang.String identifier, JSONObject args, UserActionSource source)Perform the specified action.booleanperformUserAction(android.content.Context context, java.lang.String identifier, JSONObject args)Perform the specified action.voidregisterAction(UserAction userAction)voidsetDeeplinkInterceptor(BatchDeeplinkInterceptor interceptor)Get the developer registered deeplink interceptorvoidunregisterAction(java.lang.String identifier)-
Methods inherited from class com.batch.android.module.BatchModule
batchContextBecameAvailable, batchDidStart, batchDidStop, batchIsFinishing, batchWillStart, batchWillStop
-
-
-
-
Field Detail
-
TAG
public static final java.lang.String TAG
- See Also:
- Constant Field Values
-
RESERVED_ACTION_IDENTIFIER_PREFIX
public static final java.lang.String RESERVED_ACTION_IDENTIFIER_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
registerAction
public void registerAction(@NonNull UserAction userAction)
-
unregisterAction
public void unregisterAction(@NonNull java.lang.String identifier)
-
addDrawableAlias
public void addDrawableAlias(@NonNull java.lang.String alias, @DrawableRes int drawableResID)
-
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 anyidentifier- Action identifierargs- 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 anyidentifier- Action identifierargs- Action arguments in JSON formsource- 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:BatchModuleID of the module- Specified by:
getIdin classBatchModule- Returns:
-
getState
public int getState()
Description copied from class:BatchModuleShould return the state of the module (usually 0 for deactivated, 1 for activated)- Specified by:
getStatein classBatchModule- Returns:
-
-