I have an Ionic 3 app (Ionic CLI 3.19.0, Cordova CLI 8.0.0, android platform 7.0.0,
ios platform 4.5.4) that includes the native 'Geolocation' plugin. Since iOS 10+ requires the NSLocationWhenInUseUsageDescription
property in the App-Info.plist file, the plugin's documentation (Geolocation iOS Quirks) says to include the following in the config.xml:
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
<string>need location access to find things nearby</string>
</edit-config>
So I added that verbatim as the first entry within <platform name="ios">...</platform>
tag of my config.xml.
During the cordova iOS stage of the build, it fails with the following obscure errors:
(node:60604)UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: doc.find is not a function
(node:60604) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
As mentioned in the comment above, the steps needed are:
Add the edit-config into platform name="ios" tag
<platform name="ios"> Add me here </platform>
Run prepare ios: ionic cordova prepare ios
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With