<?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-brother-label-printer"
        version="2.0.0">

    <name>BrotherPrinter</name>

    <description>Cordova hooks for Brother Print SDK</description>
    <repo>https://github.com/AbobosSoftware/cordova-plugin-brother-label-printer.git</repo>
    <keywords>brother, sdk, print</keywords>
    <license></license>

    <author>Thomas Gordon Lowrey IV</author>

    <engines>
        <engine name="cordova" version=">=3.0.0" />
    </engines>

    <!-- interface -->
    <js-module src="www/printer.js" name="BrotherPrinter">
        <clobbers target="plugin.brotherPrinter" />
        <clobbers target="cordova.plugins.brotherPrinter" />
    </js-module>

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

        <source-file src="src/android/BrotherPrinter.java" target-dir="src/com/threescreens/cordova/plugin/brotherprinter" />
        <source-file src="src/android/PrinterInputParameterConstant.java" target-dir="src/com/threescreens/cordova/plugin/brotherprinter" />


        <source-file src="src/android/Common.java" target-dir="src/com/brother/ptouch/sdk/printdemo/common" />
        <source-file src="src/android/MsgHandle.java" target-dir="src/com/brother/ptouch/sdk/printdemo/common" />

        <source-file src="src/android/BasePrint.java" target-dir="src/com/brother/ptouch/sdk/printdemo/printprocess" />
        <source-file src="src/android/ImageBitmapPrint.java" target-dir="src/com/brother/ptouch/sdk/printdemo/printprocess" />
        <source-file src="src/android/ImageFilePrint.java" target-dir="src/com/brother/ptouch/sdk/printdemo/printprocess" />

        <source-file src="src/android/libs/BrotherPrintLibrary.jar" target-dir="libs" />

        <source-file src="src/android/libs/arm64-v8a" target-dir="jniLibs" />
        <source-file src="src/android/libs/armeabi" target-dir="jniLibs" />
        <source-file src="src/android/libs/armeabi-v7a" target-dir="jniLibs" />
        <source-file src="src/android/libs/x86" target-dir="jniLibs" />
        <source-file src="src/android/libs/x86_64" target-dir="jniLibs" />


        <config-file target="AndroidManifest.xml" parent="/manifest">
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
            <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
            <!--
                        <uses-permission android:name="android.permission.BLUETOOTH" android:required="false" />
                        <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:required="false" />
            -->
            <uses-permission android:name="android.permission.INTERNET"/>
            <uses-permission android:name="android.permission.USB" android:required="false" />
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

            <uses-feature android:name="android.hardware.usb" android:required="false" />
        </config-file>
    </platform>

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

        <!--
        Commenting these ExternalAccesory configs to avoid app being rejected from app store:
        MFi - Program Authorization
        We are unable to post your app to the App Store at this time because your app has not been authorized by the accessory manufacturer to work with the MFi accessory.
        Next Steps
        To resolve this issue, please contact the accessory manufacturer to request your app be added to the MFi Product Plan form.
        -->
        <!--
                <config-file target="*-Info.plist" parent="UISupportedExternalAccessoryProtocols">
                    <array>
                        <string>com.brother.ptcbp</string>
                    </array>
                </config-file>
                <framework src="ExternalAccessory.framework" />
        -->
        <!-- fixing for capacitor https://github.com/AbobosSoftware/cordova-plugin-brother-label-printer/issues/51 -->    
        <!-- <framework src="src/ios/libs/BRLMPrinterKit.framework" custom="true"/> -->
        <podspec>
            <config>
                <source url="https://github.com/CocoaPods/Specs.git"/>
            </config>
            <pods use-frameworks="true">
                <pod name="BRLMPrinterKit" />
            </pods>
        </podspec>
        <header-file src="src/ios/BRBluetoothPrintOperation.h" />
        <source-file src="src/ios/BRBluetoothPrintOperation.m" />

        <header-file src="src/ios/BRPingOperation.h" />
        <source-file src="src/ios/BRPingOperation.m" />

        <header-file src="src/ios/BRUserDefaults.h" />

        <header-file src="src/ios/BRWLANPrintOperation.h" />
        <source-file src="src/ios/BRWLANPrintOperation.m" />

        <header-file src="src/ios/BrotherPrinter.h" />
        <source-file src="src/ios/BrotherPrinter.m" />

        <header-file src="src/ios/APPingModule.h" />
        <source-file src="src/ios/APPingModule.m" />

    </platform>
</plugin>
