> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Compliance

> Manage data tracking opt-outs and IDFA/IDFV privacy controls in your iOS app using the MoEngage SDK.

# Opt-Out of Data Tracking

To disable data tracking by the SDK use [*disableDataTracking()*](https://moengage.github.io/ios-api-reference/Classes/MoEngageSDKAnalytics.html#/c:@M@MoEngageAnalytics@objc\(cs\)MoEngageSDKAnalytics\(im\)disableDataTracking) method as shown below. Once you have opted out of data tracking you need to explicitly opt-in to start tracking any event OR attributes for the user.

<CodeGroup>
  ```swift Swift wrap theme={null}
  MoEngageSDKAnalytics.sharedInstance.disableDataTracking() //Opt out
  MoEngageSDKAnalytics.sharedInstance.enableDataTracking()  //Opt in
  ```

  ```objective-c Objective C wrap theme={null}
  [[MoEngageSDKAnalytics sharedInstance] disableDataTracking]; //Opt out
  [[MoEngageSDKAnalytics sharedInstance] enableDataTracking]; //Opt in
  ```
</CodeGroup>

# IDFA and IDFV OptOuts

SDK tracks [IDFA](https://developer.apple.com/documentation/adsupport/asidentifiermanager/1614151-advertisingidentifier)(Advertising Identifier) by default as a UserAttribute, it's tracked only if the AdSupport, AppTrackingTransparency frameworks is included in the project and if the User has not limited Ad Tracking. In case you would want to opt-out of IDFA Tracking call the opt-out method as shown below:

<CodeGroup>
  ```swift Swift wrap theme={null}
  MoEngageSDKAnalytics.sharedInstance.disableIDFATracking() //Opt out
  MoEngageSDKAnalytics.sharedInstance.enableIDFATracking() //Opt in
  ```

  ```objective-c Objective C wrap theme={null}
  [[MoEngageSDKAnalytics sharedInstance] disableIDFATracking]; //Opt out
  [[MoEngageSDKAnalytics sharedInstance] enableIDFATracking]; // Opt in
  ```
</CodeGroup>

<Warning>
  * Calling `MoEngageSDKAnalytics.sharedInstance.enableIDFATracking()` requires the `AdSupport` framework to be linked in your project. If the framework is missing, the SDK throws a fatal exception and crashes the app in `DEBUG` builds. In release builds, the call is dropped silently and IDFA is not tracked.
  * If you are upgrading an existing app and these strict `DEBUG` validations cause disruptive crashes while you refactor your tracking code, you can temporarily opt out by calling `disableIntegrationValidator()` during SDK initialization. Use this strictly as a stopgap for phased upgrades, and aim to remove the opt-out once your attribute call sites are properly validated.
</Warning>

SDK also tracks [IDFV](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor)(Identifier for Vendor) by default as a device Identifier. In case you would want to opt-out of IDFV Tracking call the opt-out method as shown below:

<CodeGroup>
  ```swift Swift wrap theme={null}
  MoEngageSDKAnalytics.sharedInstance.disableIDFVTracking() //Opt out
  MoEngageSDKAnalytics.sharedInstance.enableIDFVTracking() //Opt in
  ```

  ```objective-c Objective C wrap theme={null}
  [[MoEngageSDKAnalytics sharedInstance] disableIDFVTracking]; //Opt out
  [[MoEngageSDKAnalytics sharedInstance] enableIDFVTracking]; //Opt in
  ```
</CodeGroup>

IDFA and IDFV opt-outs are available from SDK version 6.1.1

# Enable/Disable SDK

If you don't want the MoEngage SDK to track any user information or send any data to the MoEngage System use the below method:

<CodeGroup>
  ```swift Swift theme={null}
  MoEngage.sharedInstance.disableSDK()
  ```

  ```objective-c Objective C theme={null}
  [[MoEngage sharedInstance] disableSDK];
  ```
</CodeGroup>

Once this API is called all the SDK APIs will be non-operational. SDK will be disabled until [*enableSDK()*](https://moengage.github.io/ios-api-reference/Classes/MoEngage.html#/c:@M@MoEngageSDK@objc\(cs\)MoEngage\(im\)enableSDK) is called.

Once you have the user's consent use the below API to enable the SDK.

<CodeGroup>
  ```swift Swift theme={null}
  MoEngage.sharedInstance.enableSDK()
  ```

  ```objective-c Objective C theme={null}
  [[MoEngage sharedInstance] enableSDK];
  ```
</CodeGroup>

Enable/Disable SDK methods are available from SDK version 6.3.0.
