<?xml version="1.0" encoding="UTF-8"?>

<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
        xmlns:android="http://schemas.android.com/apk/res/android"
        id="cordova-plugin-maleriepace-background-geolocation"
        version="3.0.0-alpha.14">
    <name>CDVBackgroundGeolocation</name>
    <description>Cordova Background Geolocation Plugin</description>
    <license>Apache-2.0</license>
    <keywords>cordova,phonegap,background,geolocation,gps,location</keywords>

    <engines>
        <engine name="cordova" version=">=7.1.0"/>
        <engine name="cordova-android" version=">=6.3.0"/>
        <engine name="cordova-ios" version=">=4.4.0"/>
    </engines>

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

    <js-module src="www/radio.js" name="radio">
    </js-module>

    <!-- android -->
    <platform name="android">
        <preference name="GOOGLE_PLAY_SERVICES_VERSION" default="+"/>
        <preference name="ICON" default="@mipmap/icon" />
        <preference name="SMALL_ICON" default="@mipmap/icon" />
        <preference name="ACCOUNT_NAME" default="@string/app_name" />
        <preference name="ACCOUNT_LABEL" default="@string/app_name" />
        <preference name="ACCOUNT_TYPE" default="$PACKAGE_NAME.account" />
        <preference name="CONTENT_AUTHORITY" default="$PACKAGE_NAME" />

        <framework src="android/logtofile.gradle" custom="true" type="gradleReference"/>
        <framework src="com.google.android.gms:play-services-location:$GOOGLE_PLAY_SERVICES_VERSION" />
        <framework src="com.android.support:support-v4:+" />
        <!-- Generated with gen_sources.sh @ 2017-12-15 19:49:17 -->
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/AbstractLocationProvider.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/ActivityRecognitionLocationProvider.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/BackgroundGeolocationFacade.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/BootCompletedReceiver.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/Config.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/AbstractLocationTemplate.java" target-dir="src/com/marianhello/bgloc/data" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/ArrayListLocationTemplate.java" target-dir="src/com/marianhello/bgloc/data" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/BackgroundActivity.java" target-dir="src/com/marianhello/bgloc/data" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/BackgroundLocation.java" target-dir="src/com/marianhello/bgloc/data" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/ConfigurationDAO.java" target-dir="src/com/marianhello/bgloc/data" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/DAOFactory.java" target-dir="src/com/marianhello/bgloc/data" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/HashMapLocationTemplate.java" target-dir="src/com/marianhello/bgloc/data" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/LinkedHashSetLocationTemplate.java" target-dir="src/com/marianhello/bgloc/data" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/LocationDAO.java" target-dir="src/com/marianhello/bgloc/data" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/LocationTemplateFactory.java" target-dir="src/com/marianhello/bgloc/data" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/LocationTemplate.java" target-dir="src/com/marianhello/bgloc/data" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteConfigurationContract.java" target-dir="src/com/marianhello/bgloc/data/sqlite" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteConfigurationDAO.java" target-dir="src/com/marianhello/bgloc/data/sqlite" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteLocationContract.java" target-dir="src/com/marianhello/bgloc/data/sqlite" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteLocationDAO.java" target-dir="src/com/marianhello/bgloc/data/sqlite" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/data/sqlite/SQLiteOpenHelper.java" target-dir="src/com/marianhello/bgloc/data/sqlite" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/HttpPostService.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/LocationProviderFactory.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/LocationProvider.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/LocationService.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/PluginDelegate.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/PluginError.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/RawLocationProvider.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/ResourceResolver.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/sync/AccountHelper.java" target-dir="src/com/marianhello/bgloc/sync" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/sync/Authenticator.java" target-dir="src/com/marianhello/bgloc/sync" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/sync/AuthenticatorService.java" target-dir="src/com/marianhello/bgloc/sync" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/sync/BatchManager.java" target-dir="src/com/marianhello/bgloc/sync" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/sync/DummyContentProvider.java" target-dir="src/com/marianhello/bgloc/sync" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/sync/SyncAdapter.java" target-dir="src/com/marianhello/bgloc/sync" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/sync/SyncService.java" target-dir="src/com/marianhello/bgloc/sync" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/bgloc/UploadingCallback.java" target-dir="src/com/marianhello/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/logging/DBLogReader.java" target-dir="src/com/marianhello/logging" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/logging/FileLogReader.java" target-dir="src/com/marianhello/logging" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/logging/LogEntry.java" target-dir="src/com/marianhello/logging" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/logging/LoggerManager.java" target-dir="src/com/marianhello/logging" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/logging/LogReader.java" target-dir="src/com/marianhello/logging" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/logging/SQLBuilder.java" target-dir="src/com/marianhello/logging" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/logging/SQLiteAppender.java" target-dir="src/com/marianhello/logging" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/utils/Convert.java" target-dir="src/com/marianhello/utils" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/marianhello/utils/Tone.java" target-dir="src/com/marianhello/utils" />
        <source-file src="android/BackgroundGeolocation/src/main/java/com/tenforwardconsulting/bgloc/DistanceFilterLocationProvider.java" target-dir="src/com/tenforwardconsulting/bgloc" />
        <source-file src="android/BackgroundGeolocation/src/main/java/org/apache/commons/io/Charsets.java" target-dir="src/org/apache/commons/io" />
        <source-file src="android/BackgroundGeolocation/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java" target-dir="src/org/apache/commons/io/input" />
        <source-file src="android/CDVBackgroundGeolocation/src/main/java/com/marianhello/bgloc/cordova/ConfigMapper.java" target-dir="src/com/marianhello/bgloc/cordova" />
        <source-file src="android/CDVBackgroundGeolocation/src/main/java/com/tenforwardconsulting/bgloc/cordova/BackgroundGeolocationPlugin.java" target-dir="src/com/tenforwardconsulting/bgloc/cordova" />

        <resource-file src="android/BackgroundGeolocation/src/main/res/xml/syncadapter.xml" target="res/xml/syncadapter.xml" />
        <resource-file src="android/BackgroundGeolocation/src/main/res/xml/authenticator.xml" target="res/xml/authenticator.xml" />

        <config-file target="AndroidManifest.xml" parent="/manifest/application">
            <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
            <service
                android:name="com.marianhello.bgloc.sync.SyncService"
                android:exported="true"
                android:process=":sync">
                <intent-filter>
                    <action android:name="android.content.SyncAdapter"/>
                </intent-filter>
                <meta-data android:name="android.content.SyncAdapter"
                    android:resource="@xml/syncadapter" />
            </service>
            <service
                android:name="com.marianhello.bgloc.sync.AuthenticatorService">
                <intent-filter>
                    <action android:name="android.accounts.AccountAuthenticator"/>
                </intent-filter>
                <meta-data
                    android:name="android.accounts.AccountAuthenticator"
                    android:resource="@xml/authenticator" />
            </service>
            <provider
                android:name="com.marianhello.bgloc.sync.DummyContentProvider"
                android:authorities="@string/content_authority"
                android:exported="false"
                android:syncable="true"/>
            <service
                android:enabled="true"
                android:exported="false"
                android:name="com.marianhello.bgloc.LocationService"
                />
            <receiver
                  android:name="com.marianhello.bgloc.BootCompletedReceiver"
                  android:enabled="true"
                  android:exported="true">
               <intent-filter>
                  <action android:name="android.intent.action.BOOT_COMPLETED" />
               </intent-filter>
            </receiver>
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/manifest">
            <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
            <uses-permission android:name="android.permission.GET_ACCOUNTS" />
            <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
            <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
            <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
            <uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
            <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
            <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
            <uses-permission android:name="android.permission.INTERNET" />
            <uses-permission android:name="android.permission.WAKE_LOCK" />
            <uses-permission android:name="android.hardware.location" />
        </config-file>
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="BackgroundGeolocation">
                <param name="android-package" value="com.tenforwardconsulting.bgloc.cordova.BackgroundGeolocationPlugin"/>
            </feature>
        </config-file>

        <config-file target="res/values/strings.xml" parent="/resources">
            <string name="account_name">$ACCOUNT_NAME</string>
            <string name="account_type">$ACCOUNT_TYPE</string>
            <string name="content_authority">$CONTENT_AUTHORITY</string>
        </config-file>

        <edit-config file="res/xml/authenticator.xml" target="/*" mode="overwrite">
          <account-authenticator
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:accountType="@string/account_type"
              android:icon="$ICON"
              android:smallIcon="$SMALL_ICON"
              android:label="$ACCOUNT_LABEL"/>
        </edit-config>

        <edit-config file="res/xml/syncadapter.xml" target="/*" mode="overwrite">
          <sync-adapter
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:contentAuthority="@string/content_authority"
              android:accountType="@string/account_type"
              android:userVisible="false"
              android:supportsUploading="true"
              android:allowParallelSyncs="false"
              android:isAlwaysSyncable="true"/>
        </edit-config>
    </platform>

    <platform name="ios">
        <!-- required background modes:  App registers for location updates -->
        <preference name="ALWAYS_USAGE_DESCRIPTION" default="This app always requires location tracking" />
        <preference name="MOTION_USAGE_DESCRIPTION" default="This app requires motion detection" />

        <config-file target="*-Info.plist" parent="NSLocationAlwaysUsageDescription">
            <string>$ALWAYS_USAGE_DESCRIPTION</string>
        </config-file>
        <config-file target="*-Info.plist" parent="NSLocationWhenInUseUsageDescription">
            <string>$ALWAYS_USAGE_DESCRIPTION</string>
        </config-file>
        <config-file target="*-Info.plist" parent="NSLocationAlwaysAndWhenInUseUsageDescription">
            <string>$ALWAYS_USAGE_DESCRIPTION</string>
        </config-file>
        <config-file target="*-Info.plist" parent="NSMotionUsageDescription">
            <string>$MOTION_USAGE_DESCRIPTION</string>
        </config-file>

        <config-file target="*-Info.plist" parent="UIBackgroundModes">
            <array>
                <string>location</string>
            </array>
        </config-file>

        <config-file target="*-Info.plist" parent="CFBundleURLTypes">
            <array>
              <dict>
                <key>CFBundleTypeRole</key>
                <string>Editor</string>
                <key>CFBundleURLSchemes</key>
                <array>
                  <string>prefs</string>
                </array>
              </dict>
            </array>
        </config-file>

        <config-file target="config.xml" parent="/*">
            <feature name="BackgroundGeolocation">
                <param name="ios-package" value="CDVBackgroundGeolocation" />
                <param name="onload" value="true" />
            </feature>
        </config-file>
        <framework src="CoreLocation.framework" />
        <framework src="SystemConfiguration.framework" />
        <framework src="AudioToolbox.framework" weak="true" />
        <framework src="AVFoundation.framework" weak="true" />
        <framework src="libsqlite3.dylib" weak="true" />
        <!-- Generated with gen_sources.sh @ 2018-02-24 13:30:48 -->
        <header-file src="ios/CDVBackgroundGeolocation/CDVBackgroundGeolocation.h" />
        <source-file src="ios/CDVBackgroundGeolocation/CDVBackgroundGeolocation.m" />
        <header-file src="ios/common/BackgroundGeolocation/AbstractLocationProvider.h" />
        <source-file src="ios/common/BackgroundGeolocation/AbstractLocationProvider.m" />
        <header-file src="ios/common/BackgroundGeolocation/Activity.h" />
        <source-file src="ios/common/BackgroundGeolocation/Activity.m" />
        <header-file src="ios/common/BackgroundGeolocation/ActivityLocationProvider.h" />
        <source-file src="ios/common/BackgroundGeolocation/ActivityLocationProvider.m" />
        <header-file src="ios/common/BackgroundGeolocation/BackgroundGeolocationFacade.h" />
        <source-file src="ios/common/BackgroundGeolocation/BackgroundGeolocationFacade.m" />
        <header-file src="ios/common/BackgroundGeolocation/BackgroundSync.h" />
        <source-file src="ios/common/BackgroundGeolocation/BackgroundSync.m" />
        <header-file src="ios/common/BackgroundGeolocation/BackgroundTaskManager.h" />
        <source-file src="ios/common/BackgroundGeolocation/BackgroundTaskManager.m" />
        <header-file src="ios/common/BackgroundGeolocation/CocoaLumberjack.h" />
        <source-file src="ios/common/BackgroundGeolocation/CocoaLumberjack.m" />
        <header-file src="ios/common/BackgroundGeolocation/Config.h" />
        <source-file src="ios/common/BackgroundGeolocation/Config.m" />
        <header-file src="ios/common/BackgroundGeolocation/ConfigurationContract.h" />
        <source-file src="ios/common/BackgroundGeolocation/ConfigurationContract.m" />
        <header-file src="ios/common/BackgroundGeolocation/DistanceFilterLocationProvider.h" />
        <source-file src="ios/common/BackgroundGeolocation/DistanceFilterLocationProvider.m" />
        <header-file src="ios/common/BackgroundGeolocation/FMDB.h" />
        <source-file src="ios/common/BackgroundGeolocation/FMDB.m" />
        <header-file src="ios/common/BackgroundGeolocation/FMDBLogger.h" />
        <source-file src="ios/common/BackgroundGeolocation/FMDBLogger.m" />
        <header-file src="ios/common/BackgroundGeolocation/GeolocationOpenHelper.h" />
        <source-file src="ios/common/BackgroundGeolocation/GeolocationOpenHelper.m" />
        <header-file src="ios/common/BackgroundGeolocation/Location.h" />
        <source-file src="ios/common/BackgroundGeolocation/Location.m" />
        <header-file src="ios/common/BackgroundGeolocation/LocationContract.h" />
        <source-file src="ios/common/BackgroundGeolocation/LocationContract.m" />
        <header-file src="ios/common/BackgroundGeolocation/LocationController.h" />
        <source-file src="ios/common/BackgroundGeolocation/LocationController.m" />
        <header-file src="ios/common/BackgroundGeolocation/LogReader.h" />
        <source-file src="ios/common/BackgroundGeolocation/LogReader.m" />
        <header-file src="ios/common/BackgroundGeolocation/Logging.h" />
        <header-file src="ios/common/BackgroundGeolocation/ProviderDelegate.h" />
        <header-file src="ios/common/BackgroundGeolocation/RawLocationProvider.h" />
        <source-file src="ios/common/BackgroundGeolocation/RawLocationProvider.m" />
        <header-file src="ios/common/BackgroundGeolocation/Reachability.h" />
        <source-file src="ios/common/BackgroundGeolocation/Reachability.m" />
        <header-file src="ios/common/BackgroundGeolocation/SOMotionDetector/SOLocationManager.h" />
        <source-file src="ios/common/BackgroundGeolocation/SOMotionDetector/SOLocationManager.m" />
        <header-file src="ios/common/BackgroundGeolocation/SOMotionDetector/SOMotionActivity.h" />
        <source-file src="ios/common/BackgroundGeolocation/SOMotionDetector/SOMotionActivity.m" />
        <header-file src="ios/common/BackgroundGeolocation/SOMotionDetector/SOMotionDetector.h" />
        <source-file src="ios/common/BackgroundGeolocation/SOMotionDetector/SOMotionDetector.m" />
        <header-file src="ios/common/BackgroundGeolocation/SOMotionDetector/SOStepDetector.h" />
        <source-file src="ios/common/BackgroundGeolocation/SOMotionDetector/SOStepDetector.m" />
        <header-file src="ios/common/BackgroundGeolocation/SQLiteConfigurationDAO.h" />
        <source-file src="ios/common/BackgroundGeolocation/SQLiteConfigurationDAO.m" />
        <header-file src="ios/common/BackgroundGeolocation/SQLiteHelper.h" />
        <source-file src="ios/common/BackgroundGeolocation/SQLiteHelper.m" />
        <header-file src="ios/common/BackgroundGeolocation/SQLiteLocationDAO.h" />
        <source-file src="ios/common/BackgroundGeolocation/SQLiteLocationDAO.m" />
        <header-file src="ios/common/BackgroundGeolocation/SQLiteOpenHelper.h" />
        <source-file src="ios/common/BackgroundGeolocation/SQLiteOpenHelper.m" />
     </platform>
</plugin>
