Giter VIP home page Giter VIP logo

Comments (6)

jaywcjlove avatar jaywcjlove commented on June 23, 2024

注意事项

⚠️ 高德地图定位部分 API 需要真机调试和 Access WiFi Information 权限。

Android:需要正确的设置 apiKey,获取 Key 的方法

官方获取 Key方法:https://lbs.amap.com/api/android-location-sdk/guide/create-project/get-key

A. 使用 keytool(jdk自带工具)获取 SHA1,默认 测试版本 keystore 路径 <项目名称>/android/app/debug.keystore

keytool -v -list -keystore  keystore文件路径

B. 获取 PackageName,获取路径 <项目名称>/android/app/src/main/AndroidManifest.xml

C. 在高德地图账号中设置 SHA1PackageName

D. 按照上面步骤正确设置你的 apiKey 才会起作用。

Android:无法获取逆地理信息的问题,KEY鉴权失败
  1. APK 当前签名文件的 SHA1 与高德开放平台中设置不一致
  2. Android Studio 开发者请注意调整 build.gradle 文件的 applicationIdpackageName 一致,如不一致将会导致鉴权失败。
  3. 工程中的 packageName高德开放平台packageName 设置不一致
  4. 通过 SDK 提供的 setApiKey(String key); 接口设置 Key,注意 Key 设置要在 SDK 业务初始化之前。

@cctvmikeowen 注意看文档

from react-native-amap-geolocation.

cctvmikeowen avatar cctvmikeowen commented on June 23, 2024

是真机调试的,debug和release 的appkey都设置了,核对是正确的, 权限也加了,还是返回null,连定位的授权对话框都不会弹,rn 0.64,安装采用yarn add @uiw/react-native-amap-geolocation,请问是哪里不对吗?

from react-native-amap-geolocation.

cctvmikeowen avatar cctvmikeowen commented on June 23, 2024

是真机调试的,debug和release 的appkey都设置了,核对是正确的, 权限也加了,还是返回null,连定位的授权对话框都不会弹,rn 0.64,安装采用yarn add @uiw/react-native-amap-geolocation,请问是哪里不对吗?

from react-native-amap-geolocation.

jaywcjlove avatar jaywcjlove commented on June 23, 2024

image

我没有办法帮你解决,我只能告诉你我的文档里面研究成果,按照这个核对。

from react-native-amap-geolocation.

cctvmikeowen avatar cctvmikeowen commented on June 23, 2024

你好,好像android,的有个bug,参照基本用法,js端调用AMapGeolocation.getCurrentLocation,映射到java端, @ReactMethod
public void getCurrentLocation(final Promise promise) {
try {
if (client == null) {
promise.reject("-1", "尚未调用 setApiKey() 进行初始化");
return;
}
if (!client.isStarted()) {
client.startLocation();
}
// System.out.println(mLastAMapLocation);
promise.resolve(toJSON(mLastAMapLocation));
client.stopLocation();
} catch (Exception e) {
promise.reject("-110", e.getMessage());
}
},此时mLastAMapLocation 是null的

from react-native-amap-geolocation.

jaywcjlove avatar jaywcjlove commented on June 23, 2024

SDK 监听没有接收到位置信息。

@cctvmikeowen

from react-native-amap-geolocation.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.