<?xml version="1.0" encoding="UTF-8"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
    id="cordova-plugin-getuisdk"
    version="1.1.15">
    <name>GeTuiSdk</name>
    <description>getui sdk Plugin</description>
    <license>Apache 2.0</license>
    <keywords>getui,push</keywords>

    <engines>
        <engine name="cordova-ios" version=">=3.0.0" />
        <engine name="cordova-android" version=">=3.0.0" />
    </engines>

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

        <js-module src="ios/www/GeTuiSdk.js" name="GeTuiSdk">
            <clobbers target="GeTuiSdk" />
        </js-module>

        <header-file src="ios/src/GeTuiSdkPlugin.h" target-dir="src"/>
        <source-file src="ios/src/GeTuiSdkPlugin.m" target-dir="src" />

        <framework src="ios/GtSdkLib/GTSDK.xcframework" weak="true" custom="true"/>

        <framework src="libresolv.tbd" weak="true"/>
        <framework src="libsqlite3.tbd" weak="true"/>
        <framework src="libz.tbd" weak="true"/>
        <framework src="libc++.tbd" weak="true"/>
        <framework src="CoreLocation.framework" weak="true"/>
        <framework src="CFNetwork.framework" weak="true"/>
        <framework src="CoreTelephony.framework" weak="true"/>
        <framework src="Security.framework" weak="true"/>
        <framework src="SystemConfiguration.framework" weak="true"/>
        <framework src="AVFoundation.framework" weak="true"/>
        <framework src="UserNotifications.framework" weak="true"/>
        <framework src="AppTrackingTransparency.framework" weak="true"/>
        <framework src="Network.framework" weak="true"/>
        <framework src="PushKit.framework" weak="true"/>
        <framework src="CallKit.framework" weak="true"/>
    </platform>

    <platform name="android">
        <preference name="PUSH_APPID"/>
        <preference name="PUSH_APPKEY"/>
        <preference name="PUSH_APPSECRET"/>

        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="GeTuiSdkPlugin" >
                <param name="android-package" value="com.igexin.getui.phonegap.GeTuiSdkPlugin"/>
                <param name="onload" value="true" />
            </feature>
        </config-file>

        <js-module src="android/www/GeTuiSdk.js" name="GeTuiSdkPlugin">
            <clobbers target="GeTuiSdkPlugin" />
        </js-module>


        <config-file target="AndroidManifest.xml" parent="/manifest">
            <!-- 个推SDK权限配置开始 -->
            <uses-permission android:name="android.permission.INTERNET" />
            <uses-permission android:name="android.permission.READ_PHONE_STATE" />
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
            <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
            <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
            <uses-permission android:name="android.permission.WAKE_LOCK" />
            <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
            <uses-permission android:name="android.permission.VIBRATE" />
            <uses-permission android:name="android.permission.GET_TASKS" />
            <!-- ibeancon 需要蓝牙权限 -->
            <uses-permission android:name="android.permission.BLUETOOTH"/>
            <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
            <!-- 支持个推3.0 电子围栏功能 -->
            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
            <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
            <!-- 浮动通知权限 -->
            <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
            <!-- 自定义权限 -->
            <uses-permission android:name="getui.permission.GetuiService.$PACKAGE_NAME" />
            <permission
                android:name="getui.permission.GetuiService.$PACKAGE_NAME"
                android:protectionLevel="normal" >
            </permission><!--替换为第三方应用的包名-->
            <!-- 个推SDK权限配置结束 -->
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/manifest/application">
            <!--个推SDK配置开始-->
            <!-- 配置的第三方参数属性 -->
            <meta-data
            android:name="PUSH_APPID"
            android:value="$PUSH_APPID"/>
            <meta-data
            android:name="PUSH_APPKEY"
            android:value="$PUSH_APPKEY"/>
            <meta-data
            android:name="PUSH_APPSECRET"
            android:value="$PUSH_APPSECRET"/>

            <!-- 配置SDK核心服务 -->
            <service
                android:name="com.igexin.sdk.PushService"
                android:exported="true"
                android:label="NotificationCenter"
                android:process=":pushservice" >
                <intent-filter>
                    <action android:name="com.igexin.sdk.action.service.message"/>
                </intent-filter>
            </service>

            <service
           	android:name="com.igexin.sdk.PushServiceUser"
           	android:exported="true"
            android:label="NotificationCenterUser" />
            <receiver android:name="com.igexin.sdk.PushReceiver" >
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
                    <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
                    <action android:name="android.intent.action.USER_PRESENT" />
                    <action android:name="com.igexin.sdk.action.refreshls" />
                    <!-- 以下三项为可选的action声明，可大大提高service存活率和消息到达速度 -->
                    <action android:name="android.intent.action.MEDIA_MOUNTED" />
                    <action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
                    <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
                </intent-filter>
            </receiver>

            <receiver
                android:name="com.igexin.sdk.PushManagerReceiver"
                android:exported="false" >
                <intent-filter>
                    <action android:name="com.igexin.sdk.action.pushmanager" />
                </intent-filter>
            </receiver>

			<service
				android:name="com.igexin.getui.phonegap.CordovaPushService"
				android:exported="true"
				android:label="PushService"
				android:process=":pushservice">
			</service>

            <service android:name="com.igexin.getui.phonegap.CordovaIntentService"/>


            <activity
            android:name="com.igexin.sdk.PushActivity"
            android:excludeFromRecents="true"
            android:exported="false"
            android:process=":pushservice"
            android:taskAffinity="com.igexin.sdk.PushActivityTask"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

            <activity
            android:name="com.igexin.sdk.GActivity"
            android:excludeFromRecents="true"
            android:exported="true"
            android:process=":pushservice"
            android:taskAffinity="com.igexin.sdk.PushActivityTask"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"/>

            <!-- 个推SDK配置结束 -->
        </config-file>

        <source-file src="android/GtSdkLib/android-support-v4.jar" target-dir="libs"/>
        <source-file src="android/GtSdkLib/GetuiSDK4.3.5.9.jar" target-dir="libs"/>

        <source-file src="android/GtSdkLib/arm64-v8a/libgetuiext3.so" target-dir="libs/arm64-v8a" />
        <source-file src="android/GtSdkLib/armeabi/libgetuiext3.so" target-dir="libs/armeabi" />
        <source-file src="android/GtSdkLib/armeabi-v7a/libgetuiext3.so" target-dir="libs/armeabi-v7a" />
        <source-file src="android/GtSdkLib/mips/libgetuiext3.so" target-dir="libs/mips" />
        <source-file src="android/GtSdkLib/mips64/libgetuiext3.so" target-dir="libs/mips64" />
        <source-file src="android/GtSdkLib/x86/libgetuiext3.so" target-dir="libs/x86" />
        <source-file src="android/GtSdkLib/x86_64/libgetuiext3.so" target-dir="libs/x86_64" />

        <resource-file src="android/res/layout/getui_notification.xml" target="res/layout/getui_notification.xml" />

        <resource-file src="android/res/drawable-hdpi/push.png" target="res/drawable-hdpi/push.png" />
        <resource-file src="android/res/drawable-ldpi/push.png" target="res/drawable-ldpi/push.png" />
        <resource-file src="android/res/drawable-mdpi/push.png" target="res/drawable-mdpi/push.png" />
        <resource-file src="android/res/drawable-hdpi/push_small.png" target="res/drawable-hdpi/push_small.png" />
        <resource-file src="android/res/drawable-ldpi/push_small.png" target="res/drawable-ldpi/push_small.png" />
        <resource-file src="android/res/drawable-mdpi/push_small.png" target="res/drawable-mdpi/push_small.png" />

        <source-file src="android/src/GeTuiSdkPlugin.java" target-dir="src/com/igexin/getui/phonegap" />
        <source-file src="android/src/GeTuiSdkPushBean.java" target-dir="src/com/igexin/getui/phonegap" />
        <source-file src="android/src/CordovaPushService.java" target-dir="src/com/igexin/getui/phonegap" />
        <source-file src="android/src/CordovaIntentService.java" target-dir="src/com/igexin/getui/phonegap" />

    </platform>

    <info>
        Getui sdk plugin installation succeeded.
    </info>

</plugin>
