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