你需要安装cordova-plugin-geolocation(cordova插件添加cordova-plugin-geolocation),然后在config.xml中为iOS设置首选项,例如
<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
<string>need to access your location for reasons</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysAndWhenInUseUsageDescription">
<string>need to access your location for reasons</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysUsageDescription">
<string>need to access your location for reasons</string>
</edit-config>
当然可以编辑
由于某些原因需要访问你的位置