Files
water_new/modules/Notification/Channels/AppChannel.php
2023-03-08 09:16:04 +08:00

46 lines
1.6 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace Modules\Notification\Channels;
use Illuminate\Notifications\Notification;
class AppChannel
{
/**
* APP 推送渠道
*
* @param mixed $notifiable
* @param Notification $notification
* @return void
*/
public function send($notifiable, Notification $notification)
{
// $uapi = new GTUserApi();
// $uapi->bindAlias();
// $api = new GTClient("https://restapi.getui.com", "APPKEY", "APPID", "MASTERSECRET");
// 设置推送参数
// $push = new \GTPushRequest();
// $push->setRequestId(uniqid());
// $message = new GTPushMessage();
// $notify = new GTNotification();
// $notify->setTitle("设置通知标题");
// $notify->setBody("设置通知内容");
// // 点击通知后续动作,目前支持以下后续动作:
// // 1、intent打开应用内特定页面url打开网页地址。
// // 2、payload自定义消息内容启动应用。
// // 3、payload_custom自定义消息内容不启动应用。
// // 4、startapp打开应用首页。
// // 5、none纯通知无后续动作
// $notify->setClickType("none");
// $message->setNotification($notify);
// $push->setPushMessage($message);
// $push->setCid("CID");
// //处理返回结果
// $result = $api->pushApi()->pushToSingleByCid($push);
$notification->toApp($notifiable);
}
}