<?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-mobilino-mopub"
	version="2.2.29">
      
    <name>MoPub for Cordova</name>
	<description>Cordova/PhoneGap Plugin for MoPub Ads</description>
	<author>Liming Xie</author>
	<author>Christof Lange</author>
	<license>MIT</license>
	<keywords>ad,mopub</keywords>
    <repo>https://github.com/mobilino/cordova-plugin-mopub.git</repo>
    <issue>https://github.com/mobilino/cordova-plugin-mopub/issues</issue>

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

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

	<dependency id="com.rjfun.cordova.extension"/>

    <!-- android -->
    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="MoPub">
                <param name="android-package" value="com.rjfun.cordova.mopub.MoPubPlugin"/>
            </feature>
        </config-file>
        <source-file src="src/android/MoPubPlugin.java" target-dir="src/com/rjfun/cordova/mopub" />
		

        <config-file target="AndroidManifest.xml" parent="/manifest/application">
			  <activity android:name="com.mopub.mobileads.MoPubActivity" android:configChanges="keyboardHidden|orientation"/>
			  <activity android:name="com.mopub.mobileads.MraidActivity" android:configChanges="keyboardHidden|orientation"/>
			  <activity android:name="com.mopub.common.MoPubBrowser" android:configChanges="keyboardHidden|orientation"/>
			  <activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity" android:configChanges="keyboardHidden|orientation"/>
          </config-file>
        <config-file target="AndroidManifest.xml" parent="/*">
			  <uses-permission android:name="android.permission.INTERNET" />
			  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
			  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
			  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        </config-file>
          
	    <!--  <dependency id="android.support.v4"/> -->
        <framework src="com.android.support:support-v4:23+" />
        
        <dependency id="com.google.playservices" url="https://github.com/floatinghotpot/google-play-services" commit="r19" />
        <!-- <framework src="com.google.android.gms:play-services-gcm:+" /> -->
        
        <!-- didnt work <source-file src="src/android/org.apache.http.legacy.jar" target-dir="libs" /> -->
        <!-- didnt work either <source-file src="src/android/org.jbundle.util.osgi.wrapped.org.apache.http.client-4.1.2.jar" target-dir="libs" /> -->
        
        <!-- <source-file src="src/android/mopub-volley-1.1.0.jar" target-dir="libs" />-->
        <!-- <source-file src="src/android/mopub-sdk.jar" target-dir="libs" />-->
        <!-- didnt work since jcentral is not beeing searched <framework src="com.mopub:mopub-sdk:4.4.1@aar" /> -->
        <framework src="mopub.gradle" custom="true" type="gradleReference" />
        

     </platform>
     
     <!-- ios -->
     <platform name="ios">
         <config-file target="config.xml" parent="/*">
             <feature name="MoPub">
                 <param name="ios-package" value="MoPubPlugin" />
             </feature>
         </config-file>
         <header-file src="src/ios/MoPubPlugin.h"/>
         <source-file src="src/ios/MoPubPlugin.m"/>
         
         <framework src="src/ios/MoPub.framework" custom="true"/>
         
         <resource-file src="src/ios/MoPub.framework/Resources/MPCloseButtonX.png"/>
         <resource-file src="src/ios/MoPub.framework/Resources/MPCloseButtonX@2x.png"/>
         <resource-file src="src/ios/MoPub.framework/Resources/MRAID.bundle"/>
		
        <framework src="AdSupport.framework"/>
        <framework src="CoreGraphics.framework"/>
        <framework src="CoreLocation.framework"/>
        <framework src="CoreTelephony.framework"/>
        <framework src="EventKit.framework"/>
        <framework src="EventKitUI.framework"/>
        <framework src="Foundation.framework"/>
        <framework src="MediaPlayer.framework"/>
        <framework src="MessageUI.framework"/>
        <framework src="QuartzCore.framework"/>
        <framework src="StoreKit.framework"/>
        <framework src="SystemConfiguration.framework"/>
        <framework src="UIKit.framework"/>
	</platform>

</plugin>
