Comments (12)
用ios调试,看看- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result 里面的else if([@"setApiKey" isEqualToString:method]) 有没有触发
from flutter_amap_location.
把高德的key写在iOS工程里的AppDelegate就可以获取位置信息
https://lbs.amap.com/api/ios-sdk/guide/create-project/note
from flutter_amap_location.
`
/// 初始化 iOS在init方法中设置, android需要去AndroidManifest.xml里去设置, 详见 https://lbs.amap.com/api/android-sdk/gettingstarted
if (Platform.isIOS) {
LogUtil.e('', tag: 'IOS初始化高德地图API:');
await AMapLocationClient.setApiKey('这是appKey').then((boo){
LogUtil.e('$boo', tag: 'IOS初始化高德地图API返回值:');
});
}
`
我最后处理是在 runapp
函数调用前加上以上代码就可以了。
from flutter_amap_location.
@hqwlkj 解决吗 我也遇到了问题
我再 runApp之前调用也是 定位失败
from flutter_amap_location.
@corporale
是这样 ?
from flutter_amap_location.
@jiangyh1024 差不多,我是红框的那句放在前面
from flutter_amap_location.
@corporale 红框那个就这么些就行? 不需要import 什么东西么
from flutter_amap_location.
@jiangyh1024 是的,我加了这句代码就可以获取到定位信息了,如果报错就
import AMapFoundationKit
from flutter_amap_location.
@corporale OK 谢了 明天上班我试试
from flutter_amap_location.
@corporale
还是不行
NSLocationUsageDescription
用于定位使用
NSLocationAlwaysUsageDescription
用于始终定位你的当前位置
NSLocationWhenInUseUsageDescription
用于定位您的当前位置
是不是还要加上
NSLocationAlwaysAndWhenInUseUsageDescription
用于定位您的当前位置
from flutter_amap_location.
@corporale 行了 确实要加上最后那个
from flutter_amap_location.
@jiangyh1024 好的👌
from flutter_amap_location.
Related Issues (20)
- 获取不到地理位置
- ios监听定位没有回调回来 HOT 1
- 获取不到定位信息 HOT 4
- AMapLocationClient.startup 时报错 HOT 1
- 获取定位返回接口为空
- 请问一下大家 有没有遇到过:调试定位没问题, 但是打包之后 ,定位无法实现,定位权限也开启了,但是还是获取不到定位 HOT 1
- ios 怎么需要那么多权限
- 定位异常
- android真机上运行报错
- 真机测试,ios 能获取到定位信息,Android 获取不到信息,求解答
- iOS没有城市信息, 只有经纬度 HOT 1
- onCameraMoveEnd移动定位后如何 坐标转地址?
- 谷歌商店sdk
- 支持Flutter 2.0 吗? HOT 5
- 不支持空安全 HOT 1
- Gradle下载报错,阿里云也不行
- 高德地图更新隐私解决 HOT 5
- 运行报错:未报告的异常错误Exception; 必须对其进行捕获或声明以便抛出 HOT 3
- 这个库不更新了吗,这么久都没有迭代
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_amap_location.