Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init 方法报错:AMapGeolocation.init 确保调用SDK接口前先调用更新隐私合规updatePrivacyShow、updatePrivacyAgree两个接口并且参数都为true #146

Open
wenjianli92 opened this issue Feb 17, 2022 · 2 comments
Labels
android Only for android bug Something isn't working

Comments

@wenjianli92
Copy link

wenjianli92 commented Feb 17, 2022

image

@wenjianli92 wenjianli92 added android Only for android bug Something isn't working labels Feb 17, 2022
@wenjianli92
Copy link
Author

请问,有更新计划吗

@jdl7758258
Copy link

@ReactMethod
public void init(String key, Promise promise) {
if (locationClient != null) {
locationClient.onDestroy();
}

    AMapLocationClient.setApiKey(key);
    try{
        locationClient = new AMapLocationClient(reactContext);
    }catch (Exception e){

    }
    AMapLocationClient.updatePrivacyShow(reactContext, true, true);
    AMapLocationClient.updatePrivacyAgree(reactContext, true);
    locationClient.setLocationListener(this);
    eventEmitter = reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class);
    promise.resolve(null);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Only for android bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants