{"id":22441377,"url":"https://github.com/hms-core/hms-push-serverdemo-java","last_synced_at":"2025-10-06T14:53:56.748Z","repository":{"id":50105520,"uuid":"266914593","full_name":"HMS-Core/hms-push-serverdemo-java","owner":"HMS-Core","description":"Java sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs for your reference or usage.","archived":false,"fork":false,"pushed_at":"2024-08-21T07:48:18.000Z","size":147,"stargazers_count":47,"open_issues_count":12,"forks_count":37,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-13T06:13:11.271Z","etag":null,"topics":["hms","huawei","java","push","push-notifications","sendmessage","sever"],"latest_commit_sha":null,"homepage":"https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/push-introduction","language":"Java","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-26T01:19:02.000Z","updated_at":"2025-03-03T05:34:50.000Z","dependencies_parsed_at":"2023-01-23T11:45:06.889Z","dependency_job_id":"59820f12-2c3d-4e89-919e-a261a46e2ed8","html_url":"https://github.com/HMS-Core/hms-push-serverdemo-java","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-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-push-serverdemo-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-push-serverdemo-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMS-Core%2Fhms-push-serverdemo-java/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-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670436,"owners_count":21142904,"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","java","push","push-notifications","sendmessage","sever"],"created_at":"2024-12-06T02:14:19.851Z","updated_at":"2025-10-06T14:53:51.700Z","avatar_url":"https://github.com/HMS-Core.png","language":"Java","readme":"# HMS Core Push Kit Sample Code (Java)\nEnglish | [中文](README_ZH.md)\n\n## Contents\n\n * [Introduction](#Introduction)\n * [Environment Requirements](#Environment-Requirements)\n * [Installation](#Installation)\n * [Configuration](#Configuration)\n * [Sample Code](#Sample-Code)\n * [Technical Support](#technical-support)\n * [License](#License)\n\n\n## Introduction\n\nThe sample code for Java encapsulates the server-side APIs of Push Kit, for your reference or direct use.\n\nThe following table describes packages of Java sample code.\n| Package| Description|\n| ---- | ---- |\n| examples| Sample code packages.|\n| messaging| Package where Push Kit server APIs are encapsulated.|\n\n## Environment Requirements\n\nJDK 8.0 or later is recommended.\n\n## Configuration\n\nSet the following parameters.\n\n| Parameter| Description|\n| ---- | ---- |\n| appid| App ID, which is obtained from the app information.|\n| appsecret | App secret, which is obtained from the app information.|\n| token_server | URL for Huawei OAuth 2.0 to obtain a token. For details, please refer to [OAuth 2.0-based Authentication](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/oauth2-0000001212610981?ha_source=hms1). |\n| push_open_url | Access address of Push Kit. For details, please refer to [Downlink Message Sending](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-server-dev-0000001050040110?ha_source=hms1). |\n\n## Sample Code\n\n#### 1. Send an Android data message.\nCode location: [examples/SendDataMessage.java](src/main/java/com/huawei/push/examples/SendDataMessage.java)\n\n#### 2. Send an Android notification message.\nCode location: [examples/SendNotifyMessage.java](src/main/java/com/huawei/push/examples/SendNotifyMessage.java)\n\n#### 3. Send a message by topic.\nCode location: [examples/SendTopicMessage.java](src/main/java/com/huawei/push/examples/SendTopicMessage.java)\n\n#### 4. Send a message by conditions.\nCode location: [examples/SendConditionMessage.java](src/main/java/com/huawei/push/examples/SendConditionMessage.java)\n\n#### 5. Send a message to a Huawei quick app.\nCode location: [examples/SendInstanceAppMessage.java](src/main/java/com/huawei/push/examples/SendInstanceAppMessage.java)\n\n#### 6. Send a message through the WebPush agent.\nCode location: [examples/SendWebpushMessage.java](src/main/java/com/huawei/push/examples/SendWebpushMessage.java)\n\n#### 7. Send a message through the APNs agent.\nCode location: [examples/SendApnsMessage.java](src/main/java/com/huawei/push/examples/SendApnsMessage.java)\n\n#### 8. Send a test message.\nCode location: [examples/SendTestMessage.java](src/main/java/com/huawei/push/examples/SendTestMessage.java)\n\n## Technical Support\nYou can visit the [Reddit community](https://www.reddit.com/r/HuaweiDevelopers/) to obtain the latest information about HMS Core and communicate with other developers.\n\nIf you have any questions about the sample code, try the following:\n- Visit [Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services?tab=Votes), submit your questions, and tag them with `huawei-mobile-services`. Huawei experts will answer your questions.\n- Visit the HMS Core section in the [HUAWEI Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001?ha_source=hms1) and communicate with other developers.\n\nIf you encounter any issues when using the sample code, submit your [issues](https://github.com/HMS-Core/hms-push-serverdemo-java/issues) or submit a [pull request](https://github.com/HMS-Core/hms-push-serverdemo-java/pulls).\n\n##  License\nThe sample code is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhms-core%2Fhms-push-serverdemo-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhms-core%2Fhms-push-serverdemo-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhms-core%2Fhms-push-serverdemo-java/lists"}