<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        id="cordova-plugin-timchat"
        version="4.5.6">

    <name>cordova-plugin-timchat</name>
    <description>腾讯IM</description>
    <license>MIT</license>
    <author>hankers.yan</author>
    <keywords>Tencent, IM, Cordova</keywords>

    <repo>https://github.com/hankersyan/cordova-plugin-timchat</repo>
    <issue>https://github.com/hankersyan/cordova-plugin-timchat/issues</issue>

    <preference name="SDKAPPID" /> <!--腾讯提供-->
    <preference name="IOS_BUSIID" /> <!--腾讯提供-->
    <preference name="XMPUSH_BUSIID" /> <!--腾讯提供-->
    <preference name="XMPUSH_APPID" /> <!--小米提供-->
    <preference name="XMPUSH_APPKEY" /> <!--小米提供-->
    <preference name="HWPUSH_BUSIID" /> <!--腾讯提供-->
    <preference name="HWPUSH_APPID" /> <!--华为提供-->

    <engines>
        <engine name="cordova" version=">=7.1.0"/>
        <engine name="cordova-android" version=">=6.3.0"/>
    </engines>
    <js-module src="www/timchat.js" name="TIMChat">
        <clobbers target="TIMChat"/>
    </js-module>

    <platform name="android">
        <source-file src="src/android/TIMChat.java" target-dir="src/io/hankers/cordova"/>
        <source-file src="src/android/TIMWebViewActivity.java" target-dir="src/io/hankers/cordova"/>
        <config-file target="AndroidManifest.xml" parent="/manifest/application">
            <activity android:name="io.hankers.cordova.TIMWebViewActivity" />
        </config-file>
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="TIMChat">
                <param name="android-package" value="io.hankers.cordova.TIMChat"/>
                <param name="onload" value="true" />
            </feature>
            <preference name="SDKAPPID" value="@$SDKAPPID" />
            <preference name="XMPUSH_BUSIID" value="@$XMPUSH_BUSIID" />
            <preference name="XMPUSH_APPID" value="@$XMPUSH_APPID" />
            <preference name="XMPUSH_APPKEY" value="@$XMPUSH_APPKEY" />
            <preference name="HWPUSH_BUSIID" value="@$HWPUSH_BUSIID" />
            <preference name="HWPUSH_APPID" value="@$HWPUSH_APPID" />
        </config-file>
        <resource-file src="./src/android/timc-release.aar" target="libs/timc-release.aar" />
        <resource-file src="./src/android/tuikit-release.aar" target="libs/tuikit-release.aar" />
        <framework src="./src/android/timchat.gradle" custom="true" type="gradleReference"/>
    </platform>

    <platform name="ios">

        <config-file target="config.xml" parent="/*">
            <feature name="TIMChat">
                <param name="ios-package" value="CDVTIMChat"/>
            </feature>
            <preference name="SDKAPPID" value="$SDKAPPID" />
            <preference name="IOS_BUSIID" value="$IOS_BUSIID" />
        </config-file>

        <config-file target="*-Info.plist" parent="NSCameraUsageDescription">
            <string>拍摄资料需要使用摄像头</string>
        </config-file>
        <config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
            <string>传输资料需要使用相册</string>
        </config-file>
        <config-file target="*-Info.plist" parent="NSMicrophoneUsageDescription">
            <string>需要录音</string>
        </config-file>

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

        <resource-file src="src/ios/libs/timc.framework/TUIKitFace.bundle"/>
        <resource-file src="src/ios/libs/timc.framework/TUIKitResource.bundle"/>

        <config-file target="*-Debug.plist" parent="aps-environment">
            <string>development</string>
        </config-file>
        <config-file target="*-Release.plist" parent="aps-environment">
            <string>production</string>
        </config-file>

        <framework src="src/ios/libs/timc.framework" embed="true" custom="true"/>
        <source-file src="src/ios/libs/timc.framework" target-dir="../.." framework="true" />
        <podspec>
            <config>
                <source url="https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git"/>
            </config>
            <pods>
                <pod name="TXIMSDK_iOS" spec="~> 4.7.2" />
            </pods>
        </podspec>
				
    </platform>

</plugin>