mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-02-01 15:02:54 +08:00
Merge branch 'dev'
This commit is contained in:
commit
a4eaf51455
50
README.md
50
README.md
@ -1,7 +1,7 @@
|
|||||||
# JPush PhoneGap / Cordova Plugin
|
# JPush PhoneGap / Cordova Plugin
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/jpush/jpush-phonegap-plugin.svg?branch=master)](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
[![Build Status](https://travis-ci.org/jpush/jpush-phonegap-plugin.svg?branch=master)](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
||||||
[![release](https://img.shields.io/badge/release-3.2.2-blue.svg)](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
[![release](https://img.shields.io/badge/release-3.2.3-blue.svg)](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
||||||
[![platforms](https://img.shields.io/badge/platforms-iOS%7CAndroid-lightgrey.svg)](https://github.com/jpush/jpush-phonegap-plugin)
|
[![platforms](https://img.shields.io/badge/platforms-iOS%7CAndroid-lightgrey.svg)](https://github.com/jpush/jpush-phonegap-plugin)
|
||||||
[![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
[![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
||||||
|
|
||||||
@ -13,52 +13,61 @@
|
|||||||
|
|
||||||
- 通过 Cordova Plugins 安装,要求 Cordova CLI 5.0+:
|
- 通过 Cordova Plugins 安装,要求 Cordova CLI 5.0+:
|
||||||
|
|
||||||
```
|
```shell
|
||||||
cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_jpush_appkey
|
cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_jpush_appkey
|
||||||
```
|
```
|
||||||
|
|
||||||
- 或直接通过 url 安装:
|
- 或直接通过 url 安装:
|
||||||
|
|
||||||
```
|
```shell
|
||||||
cordova plugin add https://github.com/jpush/jpush-phonegap-plugin.git --variable APP_KEY=your_jpush_appkey
|
cordova plugin add https://github.com/jpush/jpush-phonegap-plugin.git --variable APP_KEY=your_jpush_appkey
|
||||||
```
|
```
|
||||||
|
|
||||||
- 或下载到本地安装:
|
- 或下载到本地安装:
|
||||||
|
|
||||||
```
|
```shell
|
||||||
cordova plugin add Your_Plugin_Path --variable APP_KEY=your_jpush_appkey
|
cordova plugin add Your_Plugin_Path --variable APP_KEY=your_jpush_appkey
|
||||||
```
|
```
|
||||||
|
|
||||||
> 在使用 Xcode 8 调试 iOS 项目时,需要先在项目配置界面的 Capabilities 中打开 Push Notifications 开关。
|
> 在使用 Xcode 8 调试 iOS 项目时,需要先在项目配置界面的 Capabilities 中打开 Push Notifications 开关。
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
- [Common](/doc/Common_detail_api.md)
|
- [Common](/doc/Common_detail_api.md)
|
||||||
- [iOS](/doc/iOS_API.md)
|
- [iOS](/doc/iOS_API.md)
|
||||||
- [Android](/doc/Android_detail_api.md)
|
- [Android](/doc/Android_detail_api.md)
|
||||||
|
|
||||||
### Demo
|
### Demo
|
||||||
|
|
||||||
插件项目中包含一个简单的 Demo。若想参考,可以在 */example* 文件夹内找到并拷贝以下文件:
|
插件项目中包含一个简单的 Demo。若想参考,可以在 */example* 文件夹内找到并拷贝以下文件:
|
||||||
|
|
||||||
example/index.html -> www/index.html
|
example/index.html -> www/index.html
|
||||||
example/css/* -> www/css
|
example/css/* -> www/css
|
||||||
example/js/* -> www/js
|
example/js/* -> www/js
|
||||||
|
|
||||||
### 关于 PhoneGap build 云服务
|
### 关于 PhoneGap build 云服务
|
||||||
|
|
||||||
该项目基于 Cordova 实现,目前无法使用 PhoneGap build 云服务进行打包,建议使用本地环境进行打包。
|
该项目基于 Cordova 实现,目前无法使用 PhoneGap build 云服务进行打包,建议使用本地环境进行打包。
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
> 如果遇到了疑问,请优先参考 Demo 和 API 文档。若还无法解决,可到 [Issues](https://github.com/jpush/jpush-phonegap-plugin/issues) 提问。
|
> 如果遇到了疑问,请优先参考 Demo 和 API 文档。若还无法解决,可到 [Issues](https://github.com/jpush/jpush-phonegap-plugin/issues) 提问。
|
||||||
|
|
||||||
### Android
|
### Android
|
||||||
|
|
||||||
#### 在 Eclipse 中 import 工程之后出现:*Type CallbackContext cannot be resolved to a type*
|
#### 在 Eclipse 中 import 工程之后出现:*Type CallbackContext cannot be resolved to a type*
|
||||||
|
|
||||||
右键单击工程名 -> Build Path -> Config Build Path -> Projects -> 选中工程名称 -> CordovaLib -> 点击 add。
|
右键单击工程名 -> Build Path -> Config Build Path -> Projects -> 选中工程名称 -> CordovaLib -> 点击 add。
|
||||||
|
|
||||||
#### 如何自定义通知声音?
|
#### 如何自定义通知声音?
|
||||||
|
|
||||||
Android 因为各 Rom 的高度定制化,不像 iOS 一样能有一个统一的管理,如果在 Android 中想自定义通知铃声,推荐通过 JPush 推送自定义
|
Android 因为各 Rom 的高度定制化,不像 iOS 一样能有一个统一的管理,如果在 Android 中想自定义通知铃声,推荐通过 JPush 推送自定义
|
||||||
消息,之后在 `jpush.receiveMessage` 事件监听中通过 [Cordova Local-Notification Plugin]() 触发通知,再配合 [Cordova Background Plugin](https://github.com/katzer/cordova-plugin-background-mode) 插件保证应用的后台运行。
|
消息,之后在 `jpush.receiveMessage` 事件监听中通过 [Cordova Local-Notification Plugin](https://github.com/katzer/cordova-plugin-local-notifications) 触发通知,再配合 [Cordova Background Plugin](https://github.com/katzer/cordova-plugin-background-mode) 插件保证应用的后台运行。
|
||||||
|
|
||||||
#### 关闭 App 后收不到通知
|
#### 关闭 App 后收不到通知
|
||||||
|
|
||||||
Android 的推送通过长连接的方式实现,只有在连接保持的情况下才能收到通知。而有的第三方 ROM 会限制一般应用服务的自启动,也就是
|
Android 的推送通过长连接的方式实现,只有在连接保持的情况下才能收到通知。而有的第三方 ROM 会限制一般应用服务的自启动,也就是
|
||||||
在退出应用后,应用的所有服务均被杀死,且无法自启动,所以就会收不到通知。
|
在退出应用后,应用的所有服务均被杀死,且无法自启动,所以就会收不到通知。
|
||||||
|
|
||||||
@ -75,7 +84,7 @@ Android 的推送通过长连接的方式实现,只有在连接保持的情况
|
|||||||
|
|
||||||
#### 打包时遇到 i386 打包失败怎么办?
|
#### 打包时遇到 i386 打包失败怎么办?
|
||||||
|
|
||||||
```
|
```shell
|
||||||
cordova platform update ios
|
cordova platform update ios
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -91,21 +100,26 @@ cordova platform update ios
|
|||||||
- IsIDFA:是否使用 IDFA 启动 SDK。
|
- IsIDFA:是否使用 IDFA 启动 SDK。
|
||||||
|
|
||||||
#### 刚集成完插件收不到推送怎么办?
|
#### 刚集成完插件收不到推送怎么办?
|
||||||
|
|
||||||
请首先按照正确方式再次配置证书、描述文件,具体可参考 [iOS 证书设置指南](https://docs.jiguang.cn/jpush/client/iOS/ios_cer_guide/)。
|
请首先按照正确方式再次配置证书、描述文件,具体可参考 [iOS 证书设置指南](https://docs.jiguang.cn/jpush/client/iOS/ios_cer_guide/)。
|
||||||
|
|
||||||
#### iOS 集成插件白屏、或无法启动插件、或打包报错无法找到需要引入的文件怎么办?
|
#### iOS 集成插件白屏、或无法启动插件、或打包报错无法找到需要引入的文件怎么办?
|
||||||
|
|
||||||
按照以下步骤逐个尝试:
|
按照以下步骤逐个尝试:
|
||||||
|
|
||||||
- 升级至 Xcode 8
|
- 升级至最新版本 Xcode
|
||||||
- 先删除插件、再重装插件(先使用 `cordova platform add ios`,后使用 `cordova plugin add`)
|
- 删除插件、再重装插件(先使用 `cordova platform add ios`,后使用 `cordova plugin add`)
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
- QQ 群:413602425 / 524248013
|
- QQ 群:413602425 / 524248013
|
||||||
- [JPush 官网文档](https://docs.jiguang.cn/jpush/guideline/intro/)
|
- [JPush 官网文档](https://docs.jiguang.cn/jpush/guideline/intro/)
|
||||||
- [极光社区](http://community.jiguang.cn/)
|
- [极光社区](http://community.jiguang.cn/)
|
||||||
|
|
||||||
## Contribute
|
## Contribute
|
||||||
|
|
||||||
Please contribute! [Look at the issues](https://github.com/jpush/jpush-phonegap-plugin/issues).
|
Please contribute! [Look at the issues](https://github.com/jpush/jpush-phonegap-plugin/issues).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT © [JiGuang](/license)
|
MIT © [JiGuang](/license)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jpush-phonegap-plugin",
|
"name": "jpush-phonegap-plugin",
|
||||||
"version": "3.2.2",
|
"version": "3.2.3",
|
||||||
"description": "JPush for cordova plugin",
|
"description": "JPush for cordova plugin",
|
||||||
"cordova": {
|
"cordova": {
|
||||||
"id": "jpush-phonegap-plugin",
|
"id": "jpush-phonegap-plugin",
|
||||||
|
@ -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="jpush-phonegap-plugin"
|
id="jpush-phonegap-plugin"
|
||||||
version="3.2.2">
|
version="3.2.3">
|
||||||
|
|
||||||
<name>JPush</name>
|
<name>JPush</name>
|
||||||
<description>JPush for cordova plugin</description>
|
<description>JPush for cordova plugin</description>
|
||||||
@ -38,7 +38,7 @@
|
|||||||
<source-file src="src/ios/Plugins/AppDelegate+JPush.m" />
|
<source-file src="src/ios/Plugins/AppDelegate+JPush.m" />
|
||||||
|
|
||||||
<header-file src="src/ios/lib/JPUSHService.h" />
|
<header-file src="src/ios/lib/JPUSHService.h" />
|
||||||
<source-file src="src/ios/lib/jpush-ios-3.0.5.a" framework="true" />
|
<source-file src="src/ios/lib/jpush-ios-3.0.6.a" framework="true" />
|
||||||
<resource-file src="src/ios/JPushConfig.plist" />
|
<resource-file src="src/ios/JPushConfig.plist" />
|
||||||
|
|
||||||
<framework src="CFNetwork.framework" weak="true" />
|
<framework src="CFNetwork.framework" weak="true" />
|
||||||
|
Binary file not shown.
BIN
src/ios/lib/jpush-ios-3.0.6.a
Executable file
BIN
src/ios/lib/jpush-ios-3.0.6.a
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user