{"id":15939527,"url":"https://github.com/afiqiqmal/huawei-push","last_synced_at":"2025-10-19T02:30:32.526Z","repository":{"id":45655847,"uuid":"311698796","full_name":"afiqiqmal/huawei-push","owner":"afiqiqmal","description":"PHP Wrapper class for huawei push kit","archived":false,"fork":false,"pushed_at":"2021-12-02T07:32:45.000Z","size":86,"stargazers_count":7,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T08:03:45.089Z","etag":null,"topics":["composer","hacktoberfest","huawei","huawei-push","laravel","php","push-kit"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afiqiqmal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-10T15:19:29.000Z","updated_at":"2024-07-16T03:44:18.000Z","dependencies_parsed_at":"2022-08-21T07:20:41.922Z","dependency_job_id":null,"html_url":"https://github.com/afiqiqmal/huawei-push","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afiqiqmal%2Fhuawei-push","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afiqiqmal%2Fhuawei-push/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afiqiqmal%2Fhuawei-push/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afiqiqmal%2Fhuawei-push/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afiqiqmal","download_url":"https://codeload.github.com/afiqiqmal/huawei-push/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237049898,"owners_count":19246941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","hacktoberfest","huawei","huawei-push","laravel","php","push-kit"],"created_at":"2024-10-07T06:04:57.914Z","updated_at":"2025-10-19T02:30:32.183Z","avatar_url":"https://github.com/afiqiqmal.png","language":"PHP","funding_links":["https://www.paypal.com/paypalme/mhi9388?locale.x=en_US"],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/afiqiqmal/huawei-push.svg?branch=master)](https://travis-ci.org/afiqiqmal/huawei-push)\n[![Coverage](https://img.shields.io/codecov/c/github/afiqiqmal/huawei-push.svg)](https://codecov.io/gh/afiqiqmal/huawei-push)\n[![Packagist](https://img.shields.io/packagist/dt/afiqiqmal/huawei-push.svg)](https://packagist.org/packages/afiqiqmal/huawei-push)\n[![Packagist](https://img.shields.io/packagist/v/afiqiqmal/huawei-push.svg)](https://packagist.org/packages/afiqiqmal/huawei-push)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/paypalme/mhi9388?locale.x=en_US)\n\n![alt text](https://banners.beyondco.de/Huawei%20Push%20Kit%20PHP.png?theme=dark\u0026packageName=afiqiqmal%2Fhuawei-push\u0026pattern=brickWall\u0026style=style_1\u0026description=\u0026md=1\u0026showWatermark=0\u0026fontSize=100px\u0026images=cloud)\n\n# Huawei Push PHP\n\n\n### Installation\n```\ncomposer require afiqiqmal/huawei-push\n```\n\n### Usage\n\n#### Get Access Token\nReferences : [Huawei OAuth](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/open-platform-oauth-0000001053629189-V5#EN-US_TOPIC_0000001053629189__section12493191334711)\n```php\n$access = HuaweiPushKit::make([\n    'app_id' =\u003e 'YOUR APP ID',\n    'client_secret' =\u003e 'YOUR CLIENT SECRET'\n])\n    -\u003egetAccessToken();\n\n\n//Laravel\n$access = HuaweiPushKit::make(config('huawei'))-\u003egetAccessToken();\n$access = app(HuaweiPushKit::class)-\u003egetAccessToken();\n```\n\nResponse\n\n```json\n{\n    \"access_token\": \"ACCESS TOKEN\",\n    \"expires_in\": 3600, // seconds\n    \"token_type\": \"Bearer\"\n}\n```\n\n#### Push Message\n\nReferences : [Huawei Push Kit](https://developer.huawei.com/consumer/en/doc/development/HMSCore-References-V5/https-send-api-0000001050986197-V5#EN-US_TOPIC_0000001050986197__p2559323141314)\n```php\n$response = HuaweiPushKit::make([])\n    -\u003ewithAccessToken('ACCESS TOKEN')\n    -\u003epush(\n        NotificationPayload::make()\n            -\u003esetValidateOnly(false)\n            -\u003esetMessage(\n                Message::make()\n                    -\u003esetNotification(\n                        Notification::make()\n                            -\u003esetTitle(\"Testing Title\")\n                            -\u003esetBody(\"Body\")\n                            -\u003esetImage(\"https://seeklogo.com/images/L/laravel-logo-41EC1D4C3F-seeklogo.com.png\")\n                    )\n                    -\u003esetAndroid(\n                        Config::make() // AndroidConfig\n                            -\u003esetUrgency(2)\n                            -\u003esetCategory(1)\n                            -\u003esetTimeToLive(3360)\n                            -\u003esetTags('TrumpIsDown')\n                            -\u003eisStaging(true)\n                            -\u003esetNotification(\n                                AndroidNotification::make() // Notification\n                                    -\u003esetClickAction(\n                                        ClickAction::make()\n                                        -\u003esetType(1)\n                                        -\u003esetIntent(\"pushscheme://com.huawei.hms.hmsdemo/deeplink?#Intent;i.isFeed=1;S.feedDocId=0LauP4X6;end\")\n                                        -\u003esetUrl('https://www.google.com')\n                                    )\n                                    -\u003esetImage('https://seeklogo.com/images/L/laravel-logo-41EC1D4C3F-seeklogo.com.png')\n                                    -\u003esetIcon('/raw/ic_launcher2')\n                                    -\u003esetColor('#FFFFFF')\n                                    -\u003esetSound('/raw/shake')\n                                    -\u003esetDefaultSound(false)\n                                    -\u003esetPriority(3)\n                                    -\u003esetChannelId(\"HMSTestDemo\")\n                                    -\u003esetAutoClear(100000) // ms\n                                    -\u003esetSummary(\"Summary\")\n                                    -\u003esetStyle(0)\n                                    -\u003esetNotifyId(123456)\n\n                                    -\u003esetButtons([\n                                        Button::make()-\u003esetName(\"Home\")-\u003esetActionType(0)\n                                    ])\n                            )\n                    )\n                    -\u003esetTopic(\"Topic\")\n            )\n    );\n```\n\nResponse\n\n```json\n{\n    \"code\": \"80000000\",\n    \"msg\": \"Success\",\n    \"requestId\": \"160502268063038626000406\"\n}\n```\n\n\n\n### TODO\n\n- WebPUSH\n- APNS\n\n\n## License\nLicensed under the [MIT license](http://opensource.org/licenses/MIT)\n\n\n\u003ca href=\"https://www.paypal.com/paypalme/mhi9388?locale.x=en_US\"\u003e\u003cimg src=\"https://i.imgur.com/Y2gqr2j.png\" height=\"40\"\u003e\u003c/a\u003e  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafiqiqmal%2Fhuawei-push","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafiqiqmal%2Fhuawei-push","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafiqiqmal%2Fhuawei-push/lists"}