Skip to content

Commit 46819d2

Browse files
author
Helperhaps
authored
Merge pull request #39 from yzimhao/master
纠正mutable-content参数,(文档错误造成)
2 parents 61c6bc6 + 6b21916 commit 46819d2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

doc/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ $push->setNotificationAlert('alert');
7676

7777
```php
7878
// iosNotification($alert = '', array $notification = array())
79-
// 数组 $notification 的键支持 'sound', 'badge', 'content-available', 'mutable-available', category', 'extras' 中的一个或多个
79+
// 数组 $notification 的键支持 'sound', 'badge', 'content-available', 'mutable-content', category', 'extras' 中的一个或多个
8080

8181
// 调用示例
8282
$push->iosNotification();
@@ -100,7 +100,7 @@ $push->iosNotification('hello', [
100100
| sound | 表示通知提示声音,默认填充为空字符串 |
101101
| badge | 表示应用角标,把角标数字改为指定的数字;为 0 表示清除,支持 '+1','-1' 这样的字符串,表示在原有的 badge 基础上进行增减,默认填充为 '+1' |
102102
| content-available | 表示推送唤醒,仅接受 true 表示为 Background Remote Notification,若不填默认表示普通的 Remote Notification |
103-
| mutable-available | 表示通知扩展, 仅接受 true 表示支持 iOS10 的 UNNotificationServiceExtension, 若不填默认表示普通的 Remote Notification |
103+
| mutable-content | 表示通知扩展, 仅接受 true 表示支持 iOS10 的 UNNotificationServiceExtension, 若不填默认表示普通的 Remote Notification |
104104
| category | IOS8才支持。设置 APNs payload 中的 'category' 字段值 |
105105
| extras | 表示扩展字段,接受一个数组,自定义 Key/value 信息以供业务使用 |
106106

examples/push_example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
'sound' => 'sound.caf',
4141
// 'badge' => '+1',
4242
// 'content-available' => true,
43-
// 'mutable-available' => true,
43+
// 'mutable-content' => true,
4444
'category' => 'jiguang',
4545
'extras' => array(
4646
'key' => 'value',

src/JPush/PushPayload.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ private function generateSendno() {
356356

357357
# new methods
358358
public function iosNotification($alert = '', array $notification = array()) {
359-
# $required_keys = array('sound', 'badge', 'content-available', 'mutable-available', category', 'extras');
359+
# $required_keys = array('sound', 'badge', 'content-available', 'mutable-content', category', 'extras');
360360
$ios = array();
361361
$ios['alert'] = (is_string($alert) || is_array($alert)) ? $alert : '';
362362
if (!empty($notification)) {
@@ -369,8 +369,8 @@ public function iosNotification($alert = '', array $notification = array()) {
369369
if (isset($notification['content-available']) && is_bool($notification['content-available']) && $notification['content-available']) {
370370
$ios['content-available'] = $notification['content-available'];
371371
}
372-
if (isset($notification['mutable-available']) && is_bool($notification['mutable-available']) && $notification['mutable-available']) {
373-
$ios['mutable-available'] = $notification['mutable-available'];
372+
if (isset($notification['mutable-content']) && is_bool($notification['mutable-content']) && $notification['mutable-content']) {
373+
$ios['mutable-content'] = $notification['mutable-content'];
374374
}
375375
if (isset($notification['category']) && is_string($notification['category'])) {
376376
$ios['category'] = $notification['category'];

0 commit comments

Comments
 (0)