承接 afiqiqmal/huawei-push 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

afiqiqmal/huawei-push

最新稳定版本:1.4.1

Composer 安装命令:

composer require afiqiqmal/huawei-push

包简介

Simple Huawei Push in PHP

README 文档

README

Build Status Coverage Packagist Packagist Donate

alt text

Huawei Push PHP

Installation

composer require afiqiqmal/huawei-push 

Usage

Get Access Token

References : Huawei OAuth

$access = HuaweiPushKit::make([ 'app_id' => 'YOUR APP ID', 'client_secret' => 'YOUR CLIENT SECRET' ]) ->getAccessToken(); //Laravel $access = HuaweiPushKit::make(config('huawei'))->getAccessToken(); $access = app(HuaweiPushKit::class)->getAccessToken();

Response

{ "access_token": "ACCESS TOKEN", "expires_in": 3600, // seconds "token_type": "Bearer" }

Push Message

References : Huawei Push Kit

$response = HuaweiPushKit::make([]) ->withAccessToken('ACCESS TOKEN') ->push( NotificationPayload::make() ->setValidateOnly(false) ->setMessage( Message::make() ->setNotification( Notification::make() ->setTitle("Testing Title") ->setBody("Body") ->setImage("https://seeklogo.com/images/L/laravel-logo-41EC1D4C3F-seeklogo.com.png") ) ->setAndroid( Config::make() // AndroidConfig ->setUrgency(2) ->setCategory(1) ->setTimeToLive(3360) ->setTags('TrumpIsDown') ->isStaging(true) ->setNotification( AndroidNotification::make() // Notification ->setClickAction( ClickAction::make() ->setType(1) ->setIntent("pushscheme://com.huawei.hms.hmsdemo/deeplink?#Intent;i.isFeed=1;S.feedDocId=0LauP4X6;end") ->setUrl('https://www.google.com') ) ->setImage('https://seeklogo.com/images/L/laravel-logo-41EC1D4C3F-seeklogo.com.png') ->setIcon('/raw/ic_launcher2') ->setColor('#FFFFFF') ->setSound('/raw/shake') ->setDefaultSound(false) ->setPriority(3) ->setChannelId("HMSTestDemo") ->setAutoClear(100000) // ms ->setSummary("Summary") ->setStyle(0) ->setNotifyId(123456) ->setButtons([ Button::make()->setName("Home")->setActionType(0) ]) ) ) ->setTopic("Topic") ) );

Response

{ "code": "80000000", "msg": "Success", "requestId": "160502268063038626000406" }

TODO

  • WebPUSH
  • APNS

License

Licensed under the MIT license

统计信息

  • 总下载量: 66.55k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固