mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-18 21:12:56 +08:00
update doc
This commit is contained in:
parent
f177e8ae46
commit
c9cb88b9ef
4
.travis.yml
Normal file
4
.travis.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
language: node_js
|
||||||
|
sudo: false
|
||||||
|
node_js:
|
||||||
|
- "4.2"
|
@ -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;
|
||||||
|
|
||||||
### 获取集成日志
|
### 获取集成日志
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ JPush-PhoneGap-Plugin 支持 iOS, Android 的推送插件。
|
|||||||
|
|
||||||
*如需要 IM 功能插件,请关注 [jmessage-phonegap-plugin](https://github.com/jpush/jmessage-phonegap-plugin)*。
|
*如需要 IM 功能插件,请关注 [jmessage-phonegap-plugin](https://github.com/jpush/jmessage-phonegap-plugin)*。
|
||||||
|
|
||||||
## 安装 ##
|
## 安装
|
||||||
### 准备工作
|
### 准备工作
|
||||||
|
|
||||||
1. cordova create 文件夹名字 包名 应用名字
|
1. cordova create 文件夹名字 包名 应用名字
|
||||||
@ -113,6 +113,8 @@ iOS:
|
|||||||
|
|
||||||
### 常见问题
|
### 常见问题
|
||||||
|
|
||||||
|
若要使用 CLI 来编译项目,注意使用 cordova compile 而不是 cordova build,因为 cordova build 会覆盖掉对插件的修改。
|
||||||
|
|
||||||
#### 1. Android
|
#### 1. Android
|
||||||
|
|
||||||
eclipse 中 PhoneGap 工程 import 之后出现:`Type CallbackContext cannot be resolved to a type`
|
eclipse 中 PhoneGap 工程 import 之后出现:`Type CallbackContext cannot be resolved to a type`
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
id="cn.jpush.phonegap.JPushPlugin"
|
id="cn.jpush.phonegap.JPushPlugin"
|
||||||
version="2.1.0">
|
version="2.1.5">
|
||||||
|
|
||||||
<name>JPush Plugin</name>
|
<name>JPush Plugin</name>
|
||||||
<description>JPush for cordova plugin</description>
|
<description>JPush for cordova plugin</description>
|
||||||
@ -93,12 +93,14 @@
|
|||||||
<category android:name="$PACKAGE_NAME"/>
|
<category android:name="$PACKAGE_NAME"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<!-- Required SDK核心功能-->
|
<!-- Required SDK核心功能-->
|
||||||
<service
|
<service
|
||||||
android:name="cn.jpush.android.service.DownloadService"
|
android:name="cn.jpush.android.service.DownloadService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="false">
|
android:exported="false">
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<!-- Required SDK 核心功能-->
|
<!-- Required SDK 核心功能-->
|
||||||
<service
|
<service
|
||||||
android:name="cn.jpush.android.service.PushService"
|
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.REPORT"/>
|
||||||
<action android:name="cn.jpush.android.intent.PushService"/>
|
<action android:name="cn.jpush.android.intent.PushService"/>
|
||||||
<action android:name="cn.jpush.android.intent.PUSH_TIME"/>
|
<action android:name="cn.jpush.android.intent.PUSH_TIME"/>
|
||||||
|
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<!-- Required SDK核心功能-->
|
<!-- Required SDK核心功能-->
|
||||||
<receiver
|
<receiver
|
||||||
android:name="cn.jpush.android.service.PushReceiver"
|
android:name="cn.jpush.android.service.PushReceiver"
|
||||||
|
@ -9,7 +9,8 @@ module.exports = function (context) {
|
|||||||
config = new ConfigParser(path.join(context.opts.projectRoot, "config.xml")),
|
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) {
|
if (!packageName) {
|
||||||
console.error("Package name could not be found!");
|
console.error("Package name could not be found!");
|
||||||
@ -36,11 +37,11 @@ module.exports = function (context) {
|
|||||||
shell.mkdir('-p', targetDir);
|
shell.mkdir('-p', targetDir);
|
||||||
|
|
||||||
// sync the content
|
// 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) {
|
if (err) {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
data = data.replace(/^import __PACKAGE_NAME__.R;/m, 'import ' + packageName + '.R;');
|
data = data.replace(/^import __PACKAGE_NAME__.R;/m, 'import ' + packageName + '.R;');
|
||||||
fs.writeFileSync(targetFile, data);
|
fs.writeFileSync(targetFile, data);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user