cordova-amap-locate
Install AMap SDK Plugin
// Cordovacordova plugin add cordova-amap-locate --variable android_key={KEY} --variable ios_key={KEY}// Ionicionic cordova plugin add cordova-amap-locate --variable android_key={KEY} --variable ios_key={KEY}
In order to prevent error, at present you need to set the variable information of both Android and iOS.
Pay attention to IOS platform
Ios is not perfect, you need to continue to set the configuration in Xcode, but this problem will be resolved later
The plug-in relies on cordova-plugin-add-swift-support
and cordova-plugin-cocoapods-support
, so it needs to be installed in the project and configured according to the instructions.
cordova plugin add cordova-plugin-add-swift-support --savecordova plugin add cordova-plugin-cocoapod-support --save
Modify the project config.xml
......
Configuring Xcode
- First of all
check Project Signing
, if this isn't configuration, please configure the termId
.
- Second part
check Project and Pods Swift Lanaguage Version
, if it is Unspecified
, you must set a swift version. If you set the version to 4.0
, you can change the Project Format
to Xcode 8.0
.
- Third part
check Project Objective-C Bridging Header
,if it is normal, please add these to Bridging-Header.h
.
- Last
Background Modes
setOn
- selected
Location updates
Used in Cordova
cordovapluginslocate;// output: [lat:double,lng:double]
Used in Ionic
Modify the project app.module.ts
;
Use Native
;