<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-sentry" version="1.0.0">
	<name>Cordova Sentry</name>
	<author>Fergus Jordan</author>
	<description>Crash reporting with Sentry</description>
	<license>Apache 2.0</license>
	<keywords>cordova,sentry</keywords>

    <js-module src="www/sentry.js" name="Sentry">
        <clobbers target="window.Sentry" />
    </js-module>

    <platform name="android">
        <source-file src="src/android/CDVSentry.java" target-dir="src/com/kawo/cordova/sentry" />

        <framework src="src/android/sentry.gradle" custom="true" type="gradleReference" />

        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="Sentry">
                <param name="android-package" value="com.kawo.cordova.sentry.CDVSentry" />
                <param name="onload" value="true" />
            </feature>
            <preference name="DSNSTRING" value="$DSNSTRING" />
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/*">
            <uses-permission android:name="android.permission.INTERNET" />
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        </config-file>
    </platform>

    <platform name="ios">

        <dependency id="cordova-plugin-cocoapod-support" url="https://github.com/mailmangroup/cordova-plugin-cocoapods-support" />
        <pods-config ios-min-version="8.0" use-frameworks="true" />
        <pod name="Sentry" git="https://github.com/getsentry/sentry-cocoa.git" tag="3.2.0" subspecs="Core,KSCrash" />

        <config-file target="config.xml" parent="/*">
            <feature name="Sentry">
                <param name="ios-package" value="CDVSentry"/>
                <param name="onload" value="true"/>
            </feature>
            <preference name="DSNSTRING" value="$DSNSTRING" />
        </config-file>

        <header-file src="src/ios/CDVSentry.h" />
        <source-file src="src/ios/CDVSentry.m" />
    </platform>
</plugin>
