PHPackages                             alexandrfiner/huawei-push - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. alexandrfiner/huawei-push

ActiveLibrary[API Development](/categories/api)

alexandrfiner/huawei-push
=========================

Simple Huawei Push in PHP

2.0.0(1y ago)03.9k↓70.1%MITPHPPHP ^8.0

Since Jun 18Pushed 1y agoCompare

[ Source](https://github.com/AlexandrFiner/huawei-push)[ Packagist](https://packagist.org/packages/alexandrfiner/huawei-push)[ RSS](/packages/alexandrfiner-huawei-push/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

[![Build Status](https://camo.githubusercontent.com/f339554f19709d7f092615958718b3266c1afdedc842ace96fc1db31ec5de748/68747470733a2f2f7472617669732d63692e6f72672f616c6578616e647266696e65722f6875617765692d707573682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alexandrfiner/huawei-push)[![Coverage](https://camo.githubusercontent.com/271696a52024f82511e44b3f866afa510abb2b403f3ca183573d14dfeb23701e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f616c6578616e647266696e65722f6875617765692d707573682e737667)](https://codecov.io/gh/alexandrfiner/huawei-push)[![Packagist](https://camo.githubusercontent.com/219fe920eb81c84b2470fd85e276a52b0b42349cc18978d576201840cda84131/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c6578616e647266696e65722f6875617765692d707573682e737667)](https://packagist.org/packages/alexandrfiner/huawei-push)[![Packagist](https://camo.githubusercontent.com/7d03c3aa5d0e66740e7a7b7a212e3e25534888daf237268d882085c3477e8913/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c6578616e647266696e65722f6875617765692d707573682e737667)](https://packagist.org/packages/alexandrfiner/huawei-push)[![Donate](https://camo.githubusercontent.com/604e3db9c8751116b3f765aad0353ec7ded655bbe8aaacbc38d8c4a6b784b3ed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d677265656e2e737667)](https://www.paypal.com/paypalme/mhi9388?locale.x=en_US)

[![alt text](https://camo.githubusercontent.com/ec0898242e8e8131671bb41457fbb94eafb58b5ebf6cb4e632c5b9d8bca17126/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f487561776569253230507573682532304b69742532305048502e706e673f7468656d653d6461726b267061636b6167654e616d653d616c6578616e647266696e65722532466875617765692d70757368267061747465726e3d627269636b57616c6c267374796c653d7374796c655f31266465736372697074696f6e3d266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d636c6f7564)](https://camo.githubusercontent.com/ec0898242e8e8131671bb41457fbb94eafb58b5ebf6cb4e632c5b9d8bca17126/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f487561776569253230507573682532304b69742532305048502e706e673f7468656d653d6461726b267061636b6167654e616d653d616c6578616e647266696e65722532466875617765692d70757368267061747465726e3d627269636b57616c6c267374796c653d7374796c655f31266465736372697074696f6e3d266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d636c6f7564)

Huawei Push PHP
===============

[](#huawei-push-php)

### Installation

[](#installation)

```
composer require alexandrfiner/huawei-push

```

### Usage

[](#usage)

#### Get Access Token

[](#get-access-token)

References : [Huawei OAuth](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/open-platform-oauth-0000001053629189-V5#EN-US_TOPIC_0000001053629189__section12493191334711)

```
$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

[](#push-message)

References : [Huawei Push Kit](https://developer.huawei.com/consumer/en/doc/development/HMSCore-References-V5/https-send-api-0000001050986197-V5#EN-US_TOPIC_0000001050986197__p2559323141314)

```
$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

[](#todo)

- WebPUSH
- APNS

License
-------

[](#license)

Licensed under the [MIT license](http://opensource.org/licenses/MIT)

[![](https://camo.githubusercontent.com/fae49c14c08b15cedc0f829bf690717f2edabe33f88a6c67f6f8f7225702abc6/68747470733a2f2f692e696d6775722e636f6d2f5932677172326a2e706e67)](https://www.paypal.com/paypalme/mhi9388?locale.x=en_US)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance48

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

380d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f61da684920611412a1691930548bc268fccaabe12f1931c0f14d54721a6d7a1?d=identicon)[AlexandrFiner](/maintainers/AlexandrFiner)

---

Top Contributors

[![afiqiqmal](https://avatars.githubusercontent.com/u/9051312?v=4)](https://github.com/afiqiqmal "afiqiqmal (18 commits)")[![AlexandrFiner](https://avatars.githubusercontent.com/u/28213929?v=4)](https://github.com/AlexandrFiner "AlexandrFiner (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alexandrfiner-huawei-push/health.svg)

```
[![Health](https://phpackages.com/badges/alexandrfiner-huawei-push/health.svg)](https://phpackages.com/packages/alexandrfiner-huawei-push)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1943.1k5](/packages/aimeos-prisma)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
