{"id":22441371,"url":"https://github.com/hms-core/hms-push-serverdemo-php","last_synced_at":"2025-08-01T18:32:06.072Z","repository":{"id":44937595,"uuid":"266916486","full_name":"HMS-Core/hms-push-serverdemo-php","owner":"HMS-Core","description":"PHP sample code encapsulates APIs of the HUAWEI Push Kit server.It provides many sample PHP programs about quick access to HUAWEI Push Kit for your reference or usage.","archived":false,"fork":false,"pushed_at":"2023-06-28T07:59:18.000Z","size":103,"stargazers_count":24,"open_issues_count":5,"forks_count":21,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-04-16T12:54:17.415Z","etag":null,"topics":["hms","huawei","php","push","push-notifications","sendmessage","sever"],"latest_commit_sha":null,"homepage":"https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/push-introduction","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HMS-Core.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-26T01:32:10.000Z","updated_at":"2023-07-27T08:21:56.000Z","dependencies_parsed_at":"2022-08-28T03:02:05.261Z","dependency_job_id":null,"html_url":"https://github.com/HMS-Core/hms-push-serverdemo-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-push-serverdemo-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-push-serverdemo-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-push-serverdemo-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-push-serverdemo-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HMS-Core","download_url":"https://codeload.github.com/HMS-Core/hms-push-serverdemo-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228397819,"owners_count":17913540,"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":["hms","huawei","php","push","push-notifications","sendmessage","sever"],"created_at":"2024-12-06T02:14:19.269Z","updated_at":"2024-12-06T02:14:20.046Z","avatar_url":"https://github.com/HMS-Core.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HMS Pushkit PHP Severdemo\nEnglish | [中文](README_ZH.md)\n\n## Table of Contents\n * [Introduction](#introduction)\n * [Installation](#installation)\n * [Configuration](#configuration)\n * [Supported Environments](#supported-environments)\n * [Sample Code](#sample-code)\n * [Technical Support](#technical-support)\n * [License](#license)\n\n## Introduction\nPHP sample code encapsulates APIs of the HUAWEI Push Kit server.It provides many sample \nPHP programs about quick access to HUAWEI Push Kit for your reference or usage.  \nThe following table describes packages of PHP sample code.\n\n| Package        | Description\n| :---           | :---\n| [examples](src/example)   | Sample code files. Each PHP file can run independently.\n| [push_admin](src/push_admin) | Package where APIs of the HUAWEI Push Kit server are \u003cbr\u003e encapsulated.\n\n## Installation\n\nBefore using PHP sample code, check whether the PHP environment has been installed.  \n\n## Supported Environments\n\nThe PHP sample code is debugged based on the XAMPP (MySQL + PHP + PERL) 5.6.26 development suite.\n\n## Configuration \n\nThe following table describes parameters of the ____construct__ method.\n\n| Parameter              | Description\n| :---               | :---\n| __appid__   | App ID, which is obtained from app information.\n| __appsecret__ | \tSecret access key of an app, which is obtained from app information.\n| __access_token__      | URL for the Huawei OAuth 2.0 service to obtain a token, \u003cbr\u003eplease refer to [Generating an App-Level Access Token](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/oauth2-0000001212610981).\n| __hw_token_server__      | URL for accessing HUAWEI Push Kit, please refer to [Sending Messages](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-server-dev-0000001050040110?ha_source=hms1).\n\n## Sample Code\n\nPHP sample code uses the Application structure in the push_admin package as the entry.   \nCore methods in the Application structure are used to call APIs of the HUAWEI Push Kit server.  \nThe following table lists methods in Application.\n\n| Method              | Description\n| :---               | :---\n| __push_send_msg__   | Sends a message to a device.\n| __common_send_msg__ | Subscribes to a topic, unsubscribes from a topic,\u003cbr\u003eand queries the list of topics subscribed by a device.\n| ____construc__      | Constructor, which obtains key data for sending a message.\n\n#### 1.Send an Android data message.  \nCode location: [examples/test_sample_push_passthrouth_msg.php](src/example/test_sample_push_passthrouth_msg.php)             \n\n#### 2.Send an Android notification message.  \nCode location: [examples/test_sample_push_notification_msg.php](src/example/test_sample_push_notification_msg.php)\n\n#### 3.Send a message by topic.  \nCode location: [examples/test_sample_push_topic_msg.php](src/example/test_sample_push_topic_msg.php)\n\n#### 4.Send a message by conditions.  \nCode location: [examples/test_sample_push_condition_msg.php](src/example/test_sample_push_condition_msg.php)  \n\n#### 5.Send a message to a Huawei quick app.  \nCode location: [examples/test_sample_push_instantce_app_msg.php](src/example/test_sample_push_instantce_app_msg.php)        \n\n#### 6.Send a message through the WebPush agent.  \nCode location: [examples/test_sample_push_webpush_msg.php](src/example/test_sample_push_webpush_msg.php)\n\n#### 7.Send a message through the APNs agent.  \nCode location: [examples/test_sample_apns_msg.php](src/example/test_sample_apns_msg.php)\n\n#### 8.Send a test message.  \nCode location: [examples/test_sample_test_push_msg.php](src/example/test_sample_test_push_msg.php)\n\n## Technical Support\nIf you want to evaluate more about HMS Core,\n[r/HMSCore on Reddit](https://www.reddit.com/r/HuaweiDevelopers/) is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.\n\nIf you have questions about how to use HMS samples, try the following options:\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services?tab=Votes) is the best place for any programming questions. Be sure to tag your question with \n`huawei-mobile-services`.\n- [Huawei Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001) HMS Core Module is great for general questions, or seeking recommendations and opinions.\n\nIf you run into a bug in our samples, please submit an [issue](https://github.com/HMS-Core/hms-push-serverdemo-php/issues) to the Repository. Even better you can submit a [Pull Request](https://github.com/HMS-Core/hms-push-serverdemo-php/pulls) with a fix.\n\n##  License\nPushkit PHP sample is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhms-core%2Fhms-push-serverdemo-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhms-core%2Fhms-push-serverdemo-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhms-core%2Fhms-push-serverdemo-php/lists"}