 <?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="instabug-cordova"
        version="15.1.2">

    <name>instabug-cordova</name>
    <description>Cordova plugin for integrating the Instabug SDK.</description>
    <author>Instabug</author>
    <repo>https://github.com/Instabug/Instabug-Cordova</repo>
    <issue>https://github.com/Instabug/Instabug-Cordova/issues</issue>
    <license>Apache 2.0 License</license>
    <keywords>ecosystem:cordova,cordova,cordova-android,cordova-ios,instabug,debugging,errors,exceptions,logging</keywords>

    <!-- cordova -->
    <engines>
        <engine name="cordova" version=">=3.7.0"/>
    </engines>

    <!-- dependencies -->

    <!-- js -->
    <js-module src="www/ArgsRegistry.js" />
    <js-module src="www/IBGCordova.js" />
    <js-module src="www/Instabug.js" name="Instabug">
        <clobbers target="InstabugLib.Instabug" />
    </js-module>
   <js-module src="www/BugReporting.js" name="BugReporting">
        <clobbers target="InstabugLib.BugReporting" />
    </js-module>
    <js-module src="www/FeatureRequests.js" name="FeatureRequests">
        <clobbers target="InstabugLib.FeatureRequests" />
    </js-module>
    <js-module src="www/Surveys.js" name="Surveys">
        <clobbers target="InstabugLib.Surveys" />
    </js-module>
    <js-module src="www/Replies.js" name="Replies">
        <clobbers target="InstabugLib.Replies" />
    </js-module>

    <!-- android -->
    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="IBGPlugin">
                <param name="android-package" value="com.instabug.cordova.plugin.IBGPlugin"/>
                <param name="onload" value="true"/>
            </feature>
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/manifest/application">
            <service android:name="com.instabug.library.network.worker.uploader.InstabugSessionUploaderService" />
            <service android:name="com.instabug.bug.network.InstabugBugsUploaderService" />
            <service android:name="com.instabug.crash.network.InstabugCrashesUploaderService" />
            <service android:name="com.instabug.library.network.worker.fetcher.InstabugFeaturesFetcherService" />
            <service android:name="com.instabug.survey.network.service.InstabugSurveysSubmitterService" />
            <service android:name="com.instabug.library.internal.video.VideoProcessingService"/>
            <service android:name="com.instabug.library.analytics.network.InstabugAnalyticsUploaderService"/>
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/manifest">
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
            <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
            <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
            <uses-permission android:name="android.permission.RECORD_AUDIO"/>
            <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
            <uses-permission android:name="android.permission.INTERNET"/>
        </config-file>

        <framework src="com.instabug.library:instabug:12.1.0"/>

        <source-file src="src/android/IBGPlugin.java" target-dir="src/com/instabug/cordova/plugin"/>
        <source-file src="src/android/util/Util.java" target-dir="src/com/instabug/cordova/plugin/util"/>
        <source-file src="src/android/util/ArgsRegistry.java" target-dir="src/com/instabug/cordova/plugin/util"/>
    </platform>

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

        <podspec>
            <pods use-frameworks="true">
                <pod name="Instabug" spec="15.1.2" />
            </pods>
        </podspec>

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

        <header-file src="src//ios/util/ArgsRegistry.h" />
        <source-file src="src/ios/util/ArgsRegistry.m" />
    </platform>

</plugin>
