update doc

This commit is contained in:
Hevin 2016-04-21 14:51:22 +08:00
parent f177e8ae46
commit c9cb88b9ef
5 changed files with 31 additions and 22 deletions

4
.travis.yml Normal file
View File

@ -0,0 +1,4 @@
language: node_js
sudo: false
node_js:
- "4.2"

View File

@ -22,9 +22,9 @@
### 收到自定义消息时获得通知的信息
- 内容
window.plugins.jPushPlugin.openNotification.message;
window.plugins.jPushPlugin.receiveMessage.message;
- 附加字段
window.plugins.jPushPlugin.openNotification.extras.yourKey;
window.plugins.jPushPlugin.receiveMessage.extras.yourKey;
### 获取集成日志

View File

@ -18,7 +18,7 @@ JPush-PhoneGap-Plugin 支持 iOS, Android 的推送插件。
*如需要 IM 功能插件,请关注 [jmessage-phonegap-plugin](https://github.com/jpush/jmessage-phonegap-plugin)*。
## 安装 ##
## 安装
### 准备工作
1. cordova create 文件夹名字 包名 应用名字
@ -113,6 +113,8 @@ iOS:
### 常见问题
若要使用 CLI 来编译项目,注意使用 cordova compile 而不是 cordova build因为 cordova build 会覆盖掉对插件的修改。
#### 1. Android
eclipse 中 PhoneGap 工程 import 之后出现:`Type CallbackContext cannot be resolved to a type`

View File

@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cn.jpush.phonegap.JPushPlugin"
version="2.1.0">
version="2.1.5">
<name>JPush Plugin</name>
<description>JPush for cordova plugin</description>
@ -93,12 +93,14 @@
<category android:name="$PACKAGE_NAME"/>
</intent-filter>
</activity>
<!-- Required SDK核心功能-->
<service
android:name="cn.jpush.android.service.DownloadService"
android:enabled="true"
android:exported="false">
</service>
<!-- Required SDK 核心功能-->
<service
android:name="cn.jpush.android.service.PushService"
@ -109,9 +111,9 @@
<action android:name="cn.jpush.android.intent.REPORT"/>
<action android:name="cn.jpush.android.intent.PushService"/>
<action android:name="cn.jpush.android.intent.PUSH_TIME"/>
</intent-filter>
</service>
<!-- Required SDK核心功能-->
<receiver
android:name="cn.jpush.android.service.PushReceiver"

View File

@ -9,7 +9,8 @@ module.exports = function (context) {
config = new ConfigParser(path.join(context.opts.projectRoot, "config.xml")),
packageName = config.android_packageName() || config.packageName();
console.info("Running android-install.Hook: " + context.hook + ", Package: " + packageName + ", Path: " + projectRoot + ".");
console.info("Running android-install.Hook: " + context.hook
+ ", Package: " + packageName + ", Path: " + projectRoot + ".");
if (!packageName) {
console.error("Package name could not be found!");
@ -36,11 +37,11 @@ module.exports = function (context) {
shell.mkdir('-p', targetDir);
// sync the content
fs.readFile(path.join(context.opts.plugin.dir, 'src', 'android', 'JPushPlugin.java'), {encoding: 'utf-8'}, function (err, data) {
fs.readFile(path.join(context.opts.plugin.dir, 'src', 'android', 'JPushPlugin.java'),
{encoding: 'utf-8'}, function (err, data) {
if (err) {
throw err;
}
data = data.replace(/^import __PACKAGE_NAME__.R;/m, 'import ' + packageName + '.R;');
fs.writeFileSync(targetFile, data);
});