【发布时间】:2020-02-25 14:20:10
【问题描述】:
我使用 expo 创建了一个项目:
expo init geotest
接下来安装库:
npm install react-native-geolocation-service
在 app.json 中添加权限:
"android": {
"permissions": [
"ACCESS_FINE_LOCATION"
]
}
App.js 包含以下代码:
https://github.com/Agontuk/react-native-geolocation-service/blob/master/example/App.js
但是当我调用 Geolocation.getCurrentPosition 时,我收到警告:
[Unhandled promise rejection: TypeError: null is not an object (evaluating 'RNFusedLocation.getCurrentPosition')]
所有想法都结束了,请帮忙。
【问题讨论】:
标签: javascript android react-native geolocation frontend