Document Location SDK for iOS Guides Set Up Your Project Privacy Compliance

Privacy Compliance

This document describes the privacy compliance interfaces for the AMAP Location SDK. These interfaces must be called before initializing the AMapLocationManager instance to ensure compliance with privacy regulations.

Update Privacy Status

Before creating an AMapLocationManager instance, you must call the following methods to update the privacy show and agreement status.

Update Privacy Show Status

Updates whether the app has displayed a privacy alert dialog and whether that dialog includes the AMAP SDK privacy agreement.

/**
 * @brief Updates the app's privacy alert display status and whether the alert includes the AMap SDK privacy agreement.
 *        Note: Must be called before instantiating AMapLocationManager. (since 2.8.0)
 * @param showStatus The privacy alert display status.
 * @param containStatus Whether the alert contains the AMap SDK privacy agreement.
 */
+ (void)updatePrivacyShow:(AMapPrivacyShowStatus)showStatus privacyInfo:(AMapPrivacyInfoStatus)containStatus;

Update Privacy Agreement Status

Updates the user's authorization status for the AMAP SDK privacy agreement.

/**
 * @brief Updates the user's agreement status for the AMap SDK privacy agreement.
 *        Note: Must be called before instantiating AMapLocationManager. (since 2.8.0)
 * @param agreeStatus The user's agreement status for the AMap SDK privacy agreement.
 */
+ (void)updatePrivacyAgree:(AMapPrivacyAgreeStatus)agreeStatus;

Compliance Check

The SDK performs a compliance check before constructing the AMapLocationManager instance. Ensure the privacy policy is compliant by calling the following methods before creating the manager:

[AMapLocationManager updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree];
[AMapLocationManager updatePrivacyShow:AMapPrivacyShowStatusDidShow privacyInfo:AMapPrivacyInfoStatusDidContain];

Instance Creation Behavior

When calling the AMapLocationManager singleton, you must check whether the returned value is nil.

If the user has not authorized the AMAP SDK privacy agreement, or the app has not displayed the privacy alert dialog, or the dialog does not include the AMAP SDK privacy agreement, the AMapLocationManager instance creation fails and returns nil.

If all conditions are met (the user has authorized the agreement, the privacy alert has been displayed, and the alert includes the AMAP SDK privacy agreement), the AMapLocationManager instance is created successfully and returned. Location services can then be used normally.