Skip to content

Commit

Permalink
Merge pull request #8 from wenin819/master
Browse files Browse the repository at this point in the history
优化功能:去掉包名参数,走gradle配置,使更通用
  • Loading branch information
ChengTao authored Sep 7, 2017
2 parents b0441b7 + ab09893 commit c3b7d87
Show file tree
Hide file tree
Showing 13 changed files with 186 additions and 161 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Change Log
## 2.0.0 - 2017-09-07
### 升级版本
- Android SDK 3.4.5 - 2017.07.24更新
- IOS SDK 2.2.6 - 2017.06.27更新

### 优化功能
- 统一安卓与iOS实现逻辑,都走cordova.fireDocumentEvent触发事件
- 增加等待队列,在JS初始化时统一回调,保证事件不丢失

## 1.0.0 - 2017-03-28
### 增加功能
- 增加IOS实现

## 0.1.0 - 2016-08-29
### 增加功能
- 增加安卓实现
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Cordova MiPush Plugin

[![release](https://img.shields.io/badge/release-0.1.0-blue.svg)](https://github.com/ParadiseHell/mipush-cordova-plugin)
[![platforms](https://img.shields.io/badge/platforms-Android-lightgrey.svg)](https://github.com/ParadiseHell/mipush-cordova-plugin)
[![release](https://img.shields.io/badge/release-0.1.0-blue.svg)](https://github.com/wenin819/cordova-plugin-mipush)
[![platforms](https://img.shields.io/badge/platforms-Android-lightgrey.svg)](https://github.com/wenin819/cordova-plugin-mipush)

支持Android、IOS的Cordova小米推送插件

## 集成步骤

- 通过 Cordova Plugins 安装,要求 Cordova CLI 5.0+:

cordova plugin add mipush-cordova-plugin --variable PACKAGE_NAME=your_android_project_package_name --variable MI_PUSH_APP_KEY=your_mipush_appkey --variable MI_PUSH_APP_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_KEY=your_mipush_appkey
cordova plugin add cordova-plugin-mipush --variable MI_PUSH_APP_KEY=your_mipush_appkey --variable MI_PUSH_APP_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_KEY=your_mipush_appkey

- 通过Url安装:

cordova plugin add https://github.com/ParadiseHell/mipush-cordova-plugin.git --variable PACKAGE_NAME=your_android_project_package_name --variable MI_PUSH_APP_KEY=your_mipush_appkey --variable MI_PUSH_APP_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_KEY=your_mipush_appkey
cordova plugin add https://github.com/wenin819/cordova-plugin-mipush.git --variable MI_PUSH_APP_KEY=your_mipush_appkey --variable MI_PUSH_APP_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_KEY=your_mipush_appkey

- 或者下载本地安装

cordova plugin add Your_Plugin_Path --variable PACKAGE_NAME=your_android_project_package_name --variable MI_PUSH_APP_KEY=your_mipush_appkey --variable MI_PUSH_APP_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_KEY=your_mipush_appkey
cordova plugin add Your_Plugin_Path --variable MI_PUSH_APP_KEY=your_mipush_appkey --variable MI_PUSH_APP_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_ID=your_mipush_appid --variable MI_PUSH_APP_IOS_KEY=your_mipush_appkey

## Demo

Expand Down Expand Up @@ -65,9 +65,9 @@ Cordova CLI 的具体用法可参考 [Cordova CLI 官方文档](https://cordova.
## 感谢

- [极光推送cordova插件](https://github.com/jpush/jpush-phonegap-plugin)
- [cordova小米推送插件 安卓版实现](https://github.com/ParadiseHell/mipush-cordova-plugin)


## 更多

- 本项目参考极光推送cordova插件编写
- 若有问题,请发我邮件:[email protected]
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
{
"name": "mipush-cordova-plugin",
"version": "1.0.2",
"description": "Cordova MiPush Plugin",
"name": "cordova-plugin-mipush",
"version": "2.0.0",
"description": "Cordova/Phonegap MiPush Plugin",
"cordova": {
"id": "cordova-plugin-mipush",
"platforms": [
"android"
"android",
"ios"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/ParadiseHell/mipush-cordova-plugin.git"
"url": "git+https://github.com/wenin819/cordova-plugin-mipush.git"
},
"keywords": [
"cordova",
"phonegap",
"mipush",
"ecosystem:cordova",
"cordova-android"
"cordova-android",
"cordova-ios"
],
"engines": [
{
"name": "cordova",
"version": ">=3.0"
}
],
"author": "ChengTao",
"author": "https://github.com/wenin819",
"license": "Apache 2.0",
"bugs": {
"url": "https://github.com/ParadiseHell/mipush-cordova-plugin/issues"
"url": "https://github.com/wenin819/cordova-plugin-mipush/issues"
},
"homepage": "https://github.com/ParadiseHell/mipush-cordova-plugin#readme"
"homepage": "https://github.com/wenin819/cordova-plugin-mipush#readme"
}
14 changes: 6 additions & 8 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="mipush-cordova-plugin"
version="0.1.0">

id="cordova-plugin-mipush"
version="2.0.0">
<name>MiPush</name>
<description>Cordova MiPush Plugin</description>
<author>ChengTao</author>
<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="PACKAGE_NAME" />
<preference name="MI_PUSH_APP_KEY"/>
<preference name="MI_PUSH_APP_ID" />
<preference name="MI_PUSH_APP_IOS_KEY"/>
Expand Down Expand Up @@ -74,9 +72,9 @@
<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="$PACKAGE_NAME.permission.MIPUSH_RECEIVE" android:protectionLevel="signature" />
<permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" android:protectionLevel="signature" />
<!--这里com.xiaomi.mipushdemo改成app的包名-->
<uses-permission android:name="$PACKAGE_NAME.permission.MIPUSH_RECEIVE" />
<uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" />
<!--这里com.xiaomi.mipushdemo改成app的包名-->
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest/application">
Expand Down Expand Up @@ -131,7 +129,7 @@
<meta-data android:name="MiPushAppId" android:value="$MI_PUSH_APP_IDmipush"></meta-data>
</config-file>

<source-file src="src/android/MiPush_SDK_Client_3_2_2.jar" target-dir="libs" />
<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" />

Expand Down
Loading

0 comments on commit c3b7d87

Please sign in to comment.