<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" 
    xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-pixlive" version="1.25.2">
    <name>PixLive</name>
    <description>PixLive SDK plugin for Cordova based hybrid apps</description>
    <keywords>augmented reality,iBeacon</keywords>
    <license>MIT</license>
    <repo>https://github.com/vidinoti/cordova-plugin-pixlive.git</repo>
    <author>Vidinoti SA</author>

    <engines>
        <engine name="cordova" version=">=6.0.0" />
        <engine name="cordova-android" version=">=7.0.0" />
        <engine name="cordova-ios" version=">=4.0.0" />
    </engines>

    <info>
    You need to have a valid PixLive SDK license to use this plugin. Check http://www.pixlive.info for more information.
    </info>

    <js-module name="PixLive" src="www/PixLive.js">
        <clobbers target="cordova.plugins.PixLive" />
    </js-module>

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

    <preference name="LICENSE_KEY" />
    <preference name="API_URL" default="https://ar.vidinoti.com/api/api.php" />
    <preference name="SDK_URL" default="https://sdk.vidinoti.com" />

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

        <config-file target="*-Info.plist" parent="PixLiveLicense">
            <string>$LICENSE_KEY</string>
        </config-file>
        <config-file target="*-Info.plist" parent="PixLiveApiUrl">
            <string>$API_URL</string>
        </config-file>
        <config-file target="*-Info.plist" parent="PixLiveSdkUrl">
            <string>$SDK_URL</string>
        </config-file>

        <config-file target="*-Info.plist" parent="NSBluetoothAlwaysUsageDescription">
            <string>$APP_NAME tailors content based on your location.</string>
        </config-file>

        <config-file target="*-Info.plist" parent="NSBluetoothPeripheralUsageDescription">
            <string>$APP_NAME tailors content based on your location.</string>
        </config-file>

        <config-file target="*-Info.plist" parent="NSLocationWhenInUseUsageDescription">
            <string>$APP_NAME tailors content based on your location.</string>
        </config-file>

        <config-file target="*-Info.plist" parent="NSLocationAlwaysUsageDescription">
            <string>$APP_NAME tailors content based on your location.</string>
        </config-file>

        <config-file target="*-Info.plist" parent="NSLocationUsageDescription">
            <string>$APP_NAME tailors content based on your location.</string>
        </config-file>

        <config-file target="*-Info.plist" parent="NSLocationAlwaysAndWhenInUseUsageDescription">
            <string>$APP_NAME tailors content based on your location.</string>
        </config-file>

        <config-file target="*-Info.plist" parent="NSCameraUsageDescription">
            <string>$APP_NAME uses your camera to recognize articles and images.</string>
        </config-file>

        <config-file target="*-Info.plist" parent="NSPhotoLibraryAddUsageDescription">
            <string>$APP_NAME saves camera captures to your photo library.</string>
        </config-file>

        <config-file target="*-Info.plist" parent="NSAppTransportSecurity">
            <dict>
                <key>NSAllowsArbitraryLoads</key>
                <true/>
            </dict>
        </config-file>

        <config-file target="*-Info.plist" parent="UIRequiresFullScreen">
            <true/>
        </config-file>

        <config-file target="*-Info.plist" parent="UIRequiredDeviceCapabilities">
            <array>
                <string>opengles-3</string>
            </array>
        </config-file>

        <config-file parent="aps-environment" target="*/Entitlements-Release.plist">
            <string>production</string>
        </config-file>

        <source-file src="src/ios/PixLive.m" />
        <header-file src="src/ios/PixLive.h" />
        <source-file src="src/ios/CordovaARViewController.m" />
        <header-file src="src/ios/CordovaARViewController.h" />
        <source-file src="src/ios/VDARLocalizationManager.m" />
        <header-file src="src/ios/VDARLocalizationManager.h" />
        <source-file src="src/ios/HolesView.m" />
        <header-file src="src/ios/HolesView.h" />
        <framework src="Accelerate.framework" />
        <framework src="ARKit.framework" />
        <framework src="AudioToolbox.framework" />
        <framework src="AVFoundation.framework" />
        <framework src="AVKit.framework" />
        <framework src="CoreBluetooth.framework" />
        <framework src="CoreGraphics.framework" />
        <framework src="CoreLocation.framework" />
        <framework src="CoreMedia.framework" />
        <framework src="CoreMotion.framework" />
        <framework src="CoreVideo.framework" />
        <framework src="ImageIO.framework" />
        <framework src="JavaScriptCore.framework" />
        <framework src="libc++.dylib" />
        <framework src="libiconv.dylib" />
        <framework src="libz.dylib" />
        <framework src="MediaPlayer.framework" />
        <framework src="MessageUI.framework" />
        <framework src="Metal.framework" />
        <framework src="MetalKit.framework" />
        <framework src="OpenGLES.framework" />
        <framework src="QuartzCore.framework" />
        <framework src="QuickLook.framework" />
        <framework src="Security.framework" />
        <framework src="Social.framework" />
        <framework src="UserNotifications.framework" />
        <framework src="WebKit.framework" />
        <framework src="vendor/PixLive/VDARSDK.xcframework" custom="true" />
        <hook type="before_plugin_install" src="scripts/beforePluginInstall.js" />
        <hook type="after_plugin_install" src="scripts/afterPluginInstalliOS.js" />
    </platform>

    <platform name="android">
        <config-file parent="/*" target="res/xml/config.xml">
            <feature name="PixLive">
                <param name="android-package" value="com.vidinoti.pixlive.PixLive" />
                <param name="onload" value="true" />
            </feature>
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/manifest">
            <uses-permission android:name="android.permisssion.ACCESS_FINE_LOCATION" />
            <uses-permission android:name="android.permisssion.ACCESS_COARSE_LOCATION" />
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/manifest/application">
            <meta-data android:name="com.vidinoti.pixlive.LicenseKey" android:value="$LICENSE_KEY"/>
            <meta-data android:name="com.vidinoti.pixlive.ApiUrl" android:value="$API_URL"/>
            <meta-data android:name="com.vidinoti.pixlive.SdkUrl" android:value="$SDK_URL"/>
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/manifest/application">
            <meta-data android:name="com.google.ar.core" android:value="optional"/>
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/manifest/application">
            <receiver android:name="com.vidinoti.pixlive.StartSDKReceiver" android:exported="false">
                <intent-filter>
                    <action android:name="com.vidinoti.vdarsdk.android.START_SDK"/>
                </intent-filter>
            </receiver>
        </config-file>

        <source-file src="src/android/PixLive.java" target-dir="src/com/vidinoti/pixlive" />
        <source-file src="src/android/StartSDKReceiver.java" target-dir="src/com/vidinoti/pixlive" />
        <framework src="src/android/vdarsdk.gradle" custom="true" type="gradleReference" />

        <hook type="before_plugin_install" src="scripts/beforePluginInstall.js" />
    </platform>
    <hook type="after_plugin_add" src="scripts/beforePluginInstall.js" />
</plugin>
