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,8 +18,8 @@ JPush-PhoneGap-Plugin 支持 iOS, Android 的推送插件。
*如需要 IM 功能插件,请关注 [jmessage-phonegap-plugin](https://github.com/jpush/jmessage-phonegap-plugin)*。
## 安装 ##
###准备工作
## 安装
### 准备工作
1. cordova create 文件夹名字 包名 应用名字
@ -35,7 +35,7 @@ JPush-PhoneGap-Plugin 支持 iOS, Android 的推送插件。
然后再执行 `cordova plugin add xxxxx` 命令,不然有一些必须要的链接库需要手动添加
###Cordova CLI / PhoneGap 安装 Android & iOS
### Cordova CLI / PhoneGap 安装 Android & iOS
1). 安装 JPush PhoneGap Plugin, 有两种方法:
@ -78,7 +78,7 @@ JPush-PhoneGap-Plugin 支持 iOS, Android 的推送插件。
[IOS 手动安装文档地址](API/iOS_install.md)
###示例
### 示例
"$JPUSH_PLUGIN_DIR/example"文件夹内找到并拷贝以下文件
@ -86,7 +86,7 @@ JPush-PhoneGap-Plugin 支持 iOS, Android 的推送插件。
src/example/css/* to www/css
src/example/js/* to www/js
###关于'PhoneGap build'云服务
### 关于'PhoneGap build'云服务
该项目基于 cordova 实现,目前无法使用 'PhoneGap build' 云服务进行打包,建议使用本地环境进行打包
@ -111,14 +111,16 @@ iOS:
- [Android API](https://github.com/jpush/jpush-phonegap-plugin/blob/dev/API/Android_detail_api.md)
###常见问题
### 常见问题
####1. Android
若要使用 CLI 来编译项目,注意使用 cordova compile 而不是 cordova build因为 cordova build 会覆盖掉对插件的修改。
#### 1. Android
eclipse 中 PhoneGap 工程 import 之后出现:`Type CallbackContext cannot be resolved to a type`
解决方案eclipse 中右键单击工程名Build Path -> Config Build Path -> Projects -> 选中工程名称 -> CordovaLib -> 点击 add
####2. iOS
#### 2. iOS
- 设置 / 修改 APP_KEY
@ -133,5 +135,5 @@ iOS:
[iOS 证书 设置指南](http://docs.jpush.io/client/ios_tutorials/#ios_1)
###更多
### 更多
[JPush 官网文档](http://docs.jpush.io/)

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

@ -7,9 +7,10 @@ module.exports = function (context) {
projectRoot = context.opts.projectRoot,
ConfigParser = context.requireCordovaModule('cordova-lib/src/configparser/ConfigParser'),
config = new ConfigParser(path.join(context.opts.projectRoot, "config.xml")),
packageName = config.android_packageName() || config.packageName();
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,13 +37,13 @@ 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) {
if (err) {
throw err;
}
data = data.replace(/^import __PACKAGE_NAME__.R;/m, 'import ' + packageName + '.R;');
fs.writeFileSync(targetFile, 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);
});
}
};