Enable/Disable Data Tracking
If you don't want the MoEngage SDK not to track user data to the MoEngage System use the disableDataTracking() API.
import com.moengage.core.disableDataTracking
disableDataTracking(context)
MoESdkStateHelper.disableDataTracking(context);
Once the above API is called, no custom events or user attributes will be tracked. SDK will reject all events until enableDataTracking() is called.
Once you want to track events or user attributes, call the below API.
import com.moengage.core.enableDataTracking
enableDataTracking(context)
MoESdkStateHelper.enableDataTracking(context);
Enable/Disable SDK
If you don't want the MoEngage SDK not to track any user information or send any data to the MoEngage System, use the disableSdk() API.
import com.moengage.core.disableSdk
disableSdk(context)
MoESdkStateHelper.disableSdk(context);
Once this API is called, all the SDK APIs will be non-operational. SDK will be disabled until enableSdk() is called.
Once you have the user's consent use the below API to enable the SDK.
import com.moengage.core.enableSdk
enableSdk(context)
MoESdkStateHelper.enableSdk(context);