-
Notifications
You must be signed in to change notification settings - Fork 17
/
plugin.xml
137 lines (126 loc) · 6.33 KB
/
plugin.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-mipush"
version="2.0.0">
<name>MiPush</name>
<description>Cordova MiPush Plugin</description>
<author>https://github.com/wenin819</author>
<license>Apache 2.0</license>
<keywords>cordova,mipush</keywords>
<engines>
<engine name="cordova" version=">=3.0" />
</engines>
<preference name="MI_PUSH_APP_KEY"/>
<preference name="MI_PUSH_APP_ID" />
<preference name="MI_PUSH_APP_IOS_KEY"/>
<preference name="MI_PUSH_APP_IOS_ID" />
<!-- dependencies -->
<dependency id="cordova-plugin-device" />
<js-module src="www/MiPush.js" name="MiPush">
<clobbers target="MiPush" />
</js-module>
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="MiPushPlugin">
<param name="ios-package" value="MiPushPlugin" />
<param name="onload" value="true" />
</feature>
</config-file>
<config-file target="*-Info.plist" parent="MiSDKAppID">
<string>$MI_PUSH_APP_IOS_ID</string>
</config-file>
<config-file target="*-Info.plist" parent="MiSDKAppKey">
<string>$MI_PUSH_APP_IOS_KEY</string>
</config-file>
<config-file target="*-Info.plist" parent="MiSDKRun">
<string>Online</string>
</config-file>
<header-file src="src/ios/Plugins/MiPushPlugin.h" />
<source-file src="src/ios/Plugins/MiPushPlugin.m" />
<header-file src="src/ios/Plugins/AppDelegate+MiPush.h" />
<source-file src="src/ios/Plugins/AppDelegate+MiPush.m" />
<header-file src="src/ios/lib/MiPushSDK.h" />
<source-file src="src/ios/lib/libMiPushSDK.a" framework="true" />
<framework src="UserNotifications.framework" weak="true" />
<framework src="libresolv.dylib" weak="true" />
<framework src="libxml2.dylib" weak="true" />
<framework src="libz.dylib" weak="true" />
<framework src="SystemConfiguration.framework" weak="true" />
<framework src="MobileCoreServices.framework" weak="true" />
<framework src="CFNetwork.framework" weak="true" />
<framework src="CoreTelephony.framework" weak="true" />
</platform>
<platform name="android">
<config-file target="config.xml" parent="/*">
<feature name="MiPushPlugin">
<param name="android-package" value="com.ct.cordova.mipush.MiPushPlugin"/>
</feature>
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest">
<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.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.VIBRATE"/>
<permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" android:protectionLevel="signature" />
<!--这里com.xiaomi.mipushdemo改成app的包名-->
<uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" />
<!--这里com.xiaomi.mipushdemo改成app的包名-->
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<service
android:enabled="true"
android:process=":pushservice"
android:name="com.xiaomi.push.service.XMPushService"/>
<service
android:name="com.xiaomi.push.service.XMJobService"
android:enabled="true"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":pushservice" />
<!--注:此service必须在3.0.1版本以后(包括3.0.1版本)加入-->
<service
android:enabled="true"
android:exported="true"
android:name="com.xiaomi.mipush.sdk.PushMessageHandler" />
<service android:enabled="true"
android:name="com.xiaomi.mipush.sdk.MessageHandleService" />
<!--注:此service必须在2.2.5版本以后(包括2.2.5版本)加入-->
<receiver
android:exported="true"
android:name="com.xiaomi.push.service.receivers.NetworkStatusReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<receiver
android:exported="false"
android:process=":pushservice"
android:name="com.xiaomi.push.service.receivers.PingReceiver" >
<intent-filter>
<action android:name="com.xiaomi.push.PING_TIMER" />
</intent-filter>
</receiver>
<receiver
android:exported="true"
android:name="com.ct.cordova.mipush.MiPushReceiver">
<intent-filter>
<action android:name="com.xiaomi.mipush.RECEIVE_MESSAGE" />
</intent-filter>
<intent-filter>
<action android:name="com.xiaomi.mipush.MESSAGE_ARRIVED" />
</intent-filter>
<intent-filter>
<action android:name="com.xiaomi.mipush.ERROR" />
</intent-filter>
</receiver>
<meta-data android:name="MiPushAppKey" android:value="$MI_PUSH_APP_KEYmipush"></meta-data>
<meta-data android:name="MiPushAppId" android:value="$MI_PUSH_APP_IDmipush"></meta-data>
</config-file>
<source-file src="src/android/MiPush_SDK_Client_3_4_5.jar" target-dir="libs" />
<source-file src="src/android/MiPushPlugin.java" target-dir="src/com/ct/cordova/mipush" />
<source-file src="src/android/MiPushReceiver.java" target-dir="src/com/ct/cordova/mipush" />
</platform>
</plugin>