mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2026-04-19 00:03:45 +08:00
iOS 更新到6.0.0,安卓更新到6.0.1版本。iOS SDK 换成cocoapods集成,安卓 SDK换成marven集成。插件版本改成6.0.1
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
- [stopPush](#stoppush)
|
||||
- [resumePush](#resumepush)
|
||||
- [isPushStopped](#ispushstopped)
|
||||
- [getPushStatus](#getpushstatus)
|
||||
- [开启 Debug 模式](#开启-debug-模式)
|
||||
- [setDebugMode](#setdebugmode)
|
||||
- [获取 RegistrationID](#获取-registrationid)
|
||||
@@ -131,6 +132,37 @@ window.JPush.isPushStopped(function (result) {
|
||||
})
|
||||
```
|
||||
|
||||
### getPushStatus
|
||||
|
||||
- **Android 6.0.0+ / iOS 6.0.0+**:推荐使用本接口替代 `isPushStopped`,用于检查推送是否被停止。
|
||||
- 回调结果为 `{ code: number, isStopped: 0|1 }`:`code` 为 0 表示成功,非 0 表示错误码;**`isStopped` 仅在 `code === 0` 时有效**(0 表示推送未停止,1 表示推送已停止),当 `code !== 0` 时请勿依赖 `isStopped` 做业务判断。
|
||||
|
||||
#### 接口定义
|
||||
|
||||
```js
|
||||
window.JPush.getPushStatus(callback)
|
||||
```
|
||||
|
||||
#### 参数说明
|
||||
|
||||
- callback: 回调函数,参数为 `(result)`,result 为 `{ code: number, isStopped: 0|1 }`。**注意:`isStopped` 仅在 `code === 0` 时有效。**
|
||||
|
||||
#### 代码示例
|
||||
|
||||
```js
|
||||
window.JPush.getPushStatus(function (result) {
|
||||
if (result.code !== 0) {
|
||||
// 获取状态失败,不解析 isStopped
|
||||
return;
|
||||
}
|
||||
if (result.isStopped === 0) {
|
||||
// 推送未停止
|
||||
} else if (result.isStopped === 1) {
|
||||
// 推送已停止
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## 开启 Debug 模式
|
||||
### setDebugMode
|
||||
用于开启 Debug 模式,显示更多的日志信息。
|
||||
|
||||
Reference in New Issue
Block a user