<?xml version="1.0" encoding="utf-8"?>
<plugin id="cordova-plugin-xunfeiListenSpeaking" version="0.0.1"
	xmlns="http://apache.org/cordova/ns/plugins/1.0"
	xmlns:android="http://schemas.android.com/apk/res/android">
	<name>cordova-plugin-xunfeiListenSpeaking</name>
	<preference name="APP_KEY" />
	<preference name="IOS_APP_KEY" />
  <preference name="CHANNEL" default="developer-default" />
	<engines>
		<engine name="cordova" version=">=3.0" />
	</engines>
	<platform name="android">
		<js-module name="xunfeiListenSpeaking" src="www/cordova-plugin-xunfeiListenSpeaking.js">
			<clobbers target="xunfeiListenSpeaking" />
		</js-module>
		<config-file target="res/xml/config.xml" parent="/*">
			<feature name="XunfeiListenSpeaking">
				<param name="android-package" value="com.thomas.xunfeilistenspeaking.XunfeiListenSpeaking" />
				<param name="onload" value="true" />
			</feature>
		</config-file>
		<config-file target="AndroidManifest.xml" parent="/manifest">
			<!-- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> -->
			<uses-permission android:name="android.permission.RECORD_AUDIO" />
			<uses-permission android:name="android.permission.INTERNET" />
			<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
			<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
			<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
			<uses-permission android:name="android.permission.READ_PHONE_STATE" />
			<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> -->
			<!-- <uses-permission android:name="android.permission.READ_CONTACTS" /> -->
			<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
			<!-- <uses-permission android:name="android.permission.WRITE_SETTINGS" /> -->
			<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
		</config-file>
		<config-file target="AndroidManifest.xml" parent="/manifest/application">
			<activity android:name="com.thomas.xunfeilistenspeaking.XunfeiDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar">
			</activity>
		</config-file>
		<!-- assets -->
		<resource-file src="src/android/assets/iflytek/voice_bg.9.png" target="assets/iflytek/voice_bg.9.png" />
		<resource-file src="src/android/assets/iflytek/voice_empty.png" target="assets/iflytek/voice_empty.png" />
		<resource-file src="src/android/assets/iflytek/voice_full.png" target="assets/iflytek/voice_full.png" />
		<resource-file src="src/android/assets/iflytek/waiting.png" target="assets/iflytek/waiting.png" />
		<resource-file src="src/android/assets/iflytek/warning.png" target="assets/iflytek/warning.png" />
		<resource-file src="src/android/assets/iflytek/recognize.xml" target="assets/iflytek/recognize.xml" />
		<!-- lib -->
		<lib-file src="src/android/libs/Msc.jar" />
		<resource-file src="src/android/libs/armeabi-v7a/libmsc.so" target="jniLibs/armeabi-v7a/libmsc.so" />
		<resource-file src="src/android/libs/arm64-v8a/libmsc.so" target="jniLibs/arm64-v8a/libmsc.so" />
		<!-- layout -->
		<resource-file src="src/android/res/layout/ifly_layout_mnotice_image.xml" target="res/layout/ifly_layout_mnotice_image.xml" />

		<!-- src -->
		<source-file src="src/android/src/com/thomas/xunfeilistenspeaking/XunfeiListenSpeaking.java" target-dir="src/com/thomas/xunfeilistenspeaking" />
		<source-file src="src/android/src/com/thomas/xunfeilistenspeaking/IatSettings.java" target-dir="src/com/thomas/xunfeilistenspeaking" />
		<source-file src="src/android/src/com/thomas/xunfeilistenspeaking/JsonParser.java" target-dir="src/com/thomas/xunfeilistenspeaking" />
		<source-file src="src/android/src/com/thomas/xunfeilistenspeaking/SettingTextWatcher.java" target-dir="src/com/thomas/xunfeilistenspeaking" />
		<source-file src="src/android/src/com/thomas/xunfeilistenspeaking/XunfeiDialogActivity.java" target-dir="src/com/thomas/xunfeilistenspeaking" />
		<!-- res -->
		<config-file target="res/values/strings.xml" parent="/resources">
			<string name="app_id">$APP_KEY</string>
			<string name="xunfei_cancel_listen">取消语音</string>
		</config-file>
	</platform>

	<platform name="ios">
		<js-module name="speech" src="www/Speech.js">
			<!-- <clobbers target="navigator.speech" /> -->
			<clobbers target="xunfeiListenSpeaking" />
		</js-module>
		<config-file parent="/*" target="config.xml">
			<feature name="Speech">
				<param name="ios-package" value="CDVSpeech" />
			</feature>
		</config-file>

		<config-file target="*-Info.plist" parent="NSMicrophoneUsageDescription">
			<string></string>
		</config-file>

		<header-file src="src/ios/CDVSpeech.h" />
		<source-file src="src/ios/CDVSpeech.m" />
    <resource-file src="src/ios/IFlySpeechConfig.plist" />

		<framework src="AVFoundation.framework" />
		<framework src="AddressBook.framework" />
		<framework src="AudioToolbox.framework" />
		<framework src="SystemConfiguration.framework" />
		<framework src="QuartzCore.framework" />

		<framework src="libz.tbd" />
		<framework src="libc++.tbd" />
		<framework src="UIKit.framework" />
		<framework src="CoreGraphics.framework" />
		<framework src="Foundation.framework" />
		<framework src="CoreTelephony.framework" />
		<framework src="CoreLocation.framework" />
		<framework src="Contacts.framework" />
		<framework src="src/ios/iflyMSC.framework" custom="true" />
		<config-file target="*IFlySpeechConfig.plist" parent="AppKey">
            <string>$IOS_APP_KEY</string>
		</config-file>
	</platform>
</plugin>
