<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-consent" version="3.0.0-alpha.9"
    xmlns="http://apache.org/cordova/ns/plugins/1.0"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <name>@admob-plus/cordova-consent</name>
    <js-module name="Consent" src="www/consent.js">
        <clobbers target="consent" />
    </js-module>

    <platform name="android">
        <preference name="UMP_VERSION" default="3.1.0" />

        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="Consent">
                <param name="android-package" value="cordova.plugin.consent.Consent"/>
            </feature>
        </config-file>

        <source-file src="src/android/Consent.kt" target-dir="app/src/main/kotlin/cordova/plugin/consent" />
        <source-file src="src/android/ExecuteContext.kt" target-dir="app/src/main/kotlin/cordova/plugin/consent" />
        <source-file src="src/android/Generated.kt" target-dir="app/src/main/kotlin/cordova/plugin/consent" />

        <framework src="com.google.android.ump:user-messaging-platform:$UMP_VERSION" />
    </platform>

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

        <source-file src="src/ios/CSNConsent.swift" />
        <source-file src="src/ios/CSNContext.swift" />
        <source-file src="src/ios/CSNGenerated.swift" />

        <framework src="AppTrackingTransparency.framework" weak="true" />

        <podspec>
            <config>
                <source url="https://cdn.cocoapods.org/" />
            </config>
            <pods use-frameworks="true">
                <pod name="GoogleUserMessagingPlatform" spec="~> 2.5.0" />
            </pods>
        </podspec>
    </platform>
</plugin>
