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);
Delete User Data
In April 2023, Google Announced the User Account Deletion Policy, according to which if your app allows you to create an account within your app, it must also allow the user to delete their account within the app.
Calling this API will delete the User Data/Profile from the MoEngage Server. You need to have a minimum SDK version of 12.10.00 or above to call this API.
import com.moengage.core.MoECoreHelper
MoECoreHelper.deleteUser(context,listener)
import com.moengage.core.MoECoreHelper;
MoECoreHelper.INSTANCE.deleteUser(context,listener);
For more information, refer to the API Documentation.