Giter VIP home page Giter VIP logo

Comments (12)

x2201783 avatar x2201783 commented on August 25, 2024

用ios调试,看看- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result 里面的else if([@"setApiKey" isEqualToString:method]) 有没有触发

from flutter_amap_location.

corporale avatar corporale commented on August 25, 2024

把高德的key写在iOS工程里的AppDelegate就可以获取位置信息
https://lbs.amap.com/api/ios-sdk/guide/create-project/note

from flutter_amap_location.

hqwlkj avatar hqwlkj commented on August 25, 2024

`
/// 初始化 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.

jiangyh1024 avatar jiangyh1024 commented on August 25, 2024

@hqwlkj 解决吗 我也遇到了问题
我再 runApp之前调用也是 定位失败
image

from flutter_amap_location.

jiangyh1024 avatar jiangyh1024 commented on August 25, 2024

@corporale
是这样 ?
image

from flutter_amap_location.

corporale avatar corporale commented on August 25, 2024

@jiangyh1024 差不多,我是红框的那句放在前面

from flutter_amap_location.

jiangyh1024 avatar jiangyh1024 commented on August 25, 2024

@corporale 红框那个就这么些就行? 不需要import 什么东西么

from flutter_amap_location.

corporale avatar corporale commented on August 25, 2024

@jiangyh1024 是的,我加了这句代码就可以获取到定位信息了,如果报错就
import AMapFoundationKit

from flutter_amap_location.

jiangyh1024 avatar jiangyh1024 commented on August 25, 2024

@corporale OK 谢了 明天上班我试试

from flutter_amap_location.

jiangyh1024 avatar jiangyh1024 commented on August 25, 2024

@corporale
还是不行
NSLocationUsageDescription
用于定位使用
NSLocationAlwaysUsageDescription
用于始终定位你的当前位置
NSLocationWhenInUseUsageDescription
用于定位您的当前位置

是不是还要加上

NSLocationAlwaysAndWhenInUseUsageDescription
用于定位您的当前位置

from flutter_amap_location.

jiangyh1024 avatar jiangyh1024 commented on August 25, 2024

@corporale 行了 确实要加上最后那个

from flutter_amap_location.

corporale avatar corporale commented on August 25, 2024

@jiangyh1024 好的👌

from flutter_amap_location.

Related Issues (20)

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.