| @@ 74-88 (lines=15) @@ | ||
| 71 | /** |
|
| 72 | * 使用默认设置推送消息给单个android版账户. |
|
| 73 | */ |
|
| 74 | public static function PushAccountAndroid($accessId, $secretKey, $title, $content, $account) |
|
| 75 | { |
|
| 76 | $push = new self($accessId, $secretKey); |
|
| 77 | $mess = new Message(); |
|
| 78 | $mess->setTitle($title); |
|
| 79 | $mess->setContent($content); |
|
| 80 | $mess->setType(Message::TYPE_NOTIFICATION); |
|
| 81 | $mess->setStyle(new Style(0, 1, 1, 1, 0)); |
|
| 82 | $action = new ClickAction(); |
|
| 83 | $action->setActionType(ClickAction::TYPE_ACTIVITY); |
|
| 84 | $mess->setAction($action); |
|
| 85 | $ret = $push->PushSingleAccount(0, $account, $mess); |
|
| 86 | ||
| 87 | return $ret; |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * 使用默认设置推送消息给单个ios版账户. |
|
| @@ 106-120 (lines=15) @@ | ||
| 103 | /** |
|
| 104 | * 使用默认设置推送消息给所有设备android版. |
|
| 105 | */ |
|
| 106 | public static function PushAllAndroid($accessId, $secretKey, $title, $content) |
|
| 107 | { |
|
| 108 | $push = new self($accessId, $secretKey); |
|
| 109 | $mess = new Message(); |
|
| 110 | $mess->setTitle($title); |
|
| 111 | $mess->setContent($content); |
|
| 112 | $mess->setType(Message::TYPE_NOTIFICATION); |
|
| 113 | $mess->setStyle(new Style(0, 1, 1, 1, 0)); |
|
| 114 | $action = new ClickAction(); |
|
| 115 | $action->setActionType(ClickAction::TYPE_ACTIVITY); |
|
| 116 | $mess->setAction($action); |
|
| 117 | $ret = $push->PushAllDevices(0, $mess); |
|
| 118 | ||
| 119 | return $ret; |
|
| 120 | } |
|
| 121 | ||
| 122 | /** |
|
| 123 | * 使用默认设置推送消息给所有设备ios版. |
|
| @@ 138-152 (lines=15) @@ | ||
| 135 | /** |
|
| 136 | * 使用默认设置推送消息给标签选中设备android版. |
|
| 137 | */ |
|
| 138 | public static function PushTagAndroid($accessId, $secretKey, $title, $content, $tag) |
|
| 139 | { |
|
| 140 | $push = new self($accessId, $secretKey); |
|
| 141 | $mess = new Message(); |
|
| 142 | $mess->setTitle($title); |
|
| 143 | $mess->setContent($content); |
|
| 144 | $mess->setType(Message::TYPE_NOTIFICATION); |
|
| 145 | $mess->setStyle(new Style(0, 1, 1, 1, 0)); |
|
| 146 | $action = new ClickAction(); |
|
| 147 | $action->setActionType(ClickAction::TYPE_ACTIVITY); |
|
| 148 | $mess->setAction($action); |
|
| 149 | $ret = $push->PushTags(0, [0 => $tag], 'OR', $mess); |
|
| 150 | ||
| 151 | return $ret; |
|
| 152 | } |
|
| 153 | ||
| 154 | /** |
|
| 155 | * 使用默认设置推送消息给标签选中设备ios版. |
|