<?xml version="1.0" encoding="UTF-8" ?>
<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
    id="au.com.bluedot.bdpointsdk"
    version="1.14.0">

    <!-- This plugin requires Cordova version 8.0.0 or newer. -->
    <engines>
        <engine name="cordova" version=">=9.0.0" />
    </engines>

    <name>Bluedot Point SDK</name>

    <js-module src="bluedotPointSDKCDVPlugin.js" name="BluedotPointSDKCDVPlugin">
        <clobbers target="au.com.bluedot" />
    </js-module>

    <platform name="ios">
        <config-file target="config.xml" parent="/*">
            <feature name="BDPointSDK">
                <param name="ios-package" value="BluedotPointSDKCDVPlugin" />
            </feature>
        </config-file>

        <!-- The app provides a description for the use of background location updates -->
        <config-file target="*-Info.plist" parent="NSLocationAlwaysUsageDescription">
            <string>Allow location-based actions to be triggered while in the background</string>
        </config-file>

        <!-- The app is able to run in background through location updates -->
        <config-file target="*-Info.plist" parent="UIBackgroundModes">
            <array>
                <string>location</string>
            </array>
        </config-file>
        <header-file src="src/ios/BluedotPointSDKCDVPlugin.h" />
        <source-file src="src/ios/BluedotPointSDKCDVPlugin.m" />

        <!--  The following lists the frameworks required for building the SDK -->
        <framework src="CoreLocation.framework" />
        <framework src="CoreMotion.framework" />
        <framework src="CoreGraphics.framework" />
        <framework src="CoreData.framework" />
        <framework src="MapKit.framework" />
        <framework src="UIKit.framework" />
        <framework src="SystemConfiguration.framework" />

        <!-- Point SDK -->
        <framework src="src/ios/BDPointSDK.framework" custom="true" embed="true" target-dir="src/au/com/bluedot" />

    </platform>

    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="BDPointSDK" >
                <param name="android-package" value="au.com.bluedot.BDPointSDKWrapper"/>
            </feature>
        </config-file>

        <!-- google-play-services is not used by Bluedot Point SDK but is required for installing security providers https://developer.android.com/training/articles/security-gms-provider.html -->
        <framework src="com.google.android.gms:play-services-base:15.0.1" />
        <framework src="com.google.android.gms:play-services-location:16.0.0" />

        <!-- Adding custom gradle file to import Bluedot Android Point SDK Dependency -->
        <framework src="src/android/bluedotplugin.gradle" custom="true" type="gradleReference"/>

        <source-file src="src/android/BDPointSDKWrapper.java" target-dir="src/au/com/bluedot" />

    </platform>
</plugin>
