<?xml version="1.0" encoding="utf-8"?>
<plugin id="cordova-plugin-nativegeocoder" version="3.2.2" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
	<name>NativeGeocoder</name>
    <description>Cordova plugin for native forward and reverse geocoding</description>
    <license>MIT</license>
    <keywords>cordova,geocoder,geocoding,reverse,forward,location</keywords>

	<js-module name="NativeGeocoder" src="www/NativeGeocoder.js">
		<clobbers target="nativegeocoder" />
	</js-module>

    <!-- android -->
	<platform name="android">
		<config-file parent="/*" target="res/xml/config.xml">
			<feature name="NativeGeocoder">
				<param name="android-package" value="cordova.plugin.nativegeocoder.NativeGeocoder" />
			</feature>
		</config-file>

		<config-file parent="/*" target="AndroidManifest.xml">
            <uses-permission android:name="android.permission.INTERNET" />
			<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        </config-file>

        <source-file src="src/android/NativeGeocoder.java" target-dir="src/cordova/plugin/nativegeocoder" />
	</platform>

    <!-- ios -->
	<platform name="ios">
		<preference name="LOCATION_WHEN_IN_USE_DESCRIPTION" default="Use geocoder service" />

		<config-file parent="/*" target="config.xml">
			<feature name="NativeGeocoder">
				<param name="ios-package" value="NativeGeocoder" />
			</feature>
		</config-file>
		<header-file src="src/ios/NativeGeocoder-Bridging-Header.h" />

		<source-file src="src/ios/NativeGeocoder.swift" />
        <framework src="CoreLocation.framework" />
        
        <config-file target="*-Info.plist" parent="NSLocationWhenInUseUsageDescription">
            <string>$LOCATION_WHEN_IN_USE_DESCRIPTION</string>
        </config-file>

        <dependency id="cordova-plugin-add-swift-support" version="2.0.2"/>
	</platform>

</plugin>
