Skip to content

Commit eedf8e3

Browse files
committed
Update Readme
1 parent 5635d3e commit eedf8e3

2 files changed

Lines changed: 78 additions & 88 deletions

File tree

README.md

Lines changed: 49 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,75 @@
1-
# HMS Pushkit Java Severdemo
2-
English | [中文](https://github.com/HMS-Core/hms-push-serverdemo-java/blob/master/README_ZH.md)
3-
4-
## Table of Contents
5-
6-
* [Introduction](#introduction)
7-
* [Supported Environments](#supported-environments)
8-
* [Installation](#installation)
9-
* [Configuration ](#configuration )
10-
* [Sample Code](#sample-code)
11-
* [License](#license)
12-
13-
1+
# HMS Core Push Kit Sample Code (Java)
2+
English | [中文](README_ZH.md)
3+
4+
## Contents
5+
6+
* [Introduction](#Introduction)
7+
* [Environment Requirements](#Environment-Requirements)
8+
* [Installation](#Installation)
9+
* [Configuration](#Configuration)
10+
* [Sample Code](#Sample-Code)
11+
* [License](#License)
12+
13+
1414
## Introduction
1515

16-
Java sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs for your reference or usage.
16+
The sample code for Java encapsulates the server-side APIs of Push Kit, for your reference or direct use.
1717

1818
The following table describes packages of Java sample code.
19-
20-
| Package | Description |
19+
| Package| Description|
2120
| ---- | ---- |
22-
| examples | Sample code packages. Each package can run independently. |
23-
| messaging | Package where APIs of the HUAWEI Push Kit server are encapsulated. |
24-
25-
## Supported Environments
21+
| examples| Sample code packages.|
22+
| messaging| Package where Push Kit server APIs are encapsulated.|
2623

27-
For HUAWEI Push Kit, JDK 8.0 or later and IntelliJ IDEA are recommended.
24+
## Environment Requirements
2825

29-
## Installation
30-
Configure your build tool to import the sample code into your IDE.
26+
JDK 8.0 or later is recommended.
3127

32-
## Configuration
28+
## Configuration
3329

34-
The following table lists parameters to be set.
30+
Set the following parameters.
3531

36-
| Parameter | Description |
32+
| Parameter| Description|
3733
| ---- | ---- |
38-
| appid | App ID, which is obtained from app information. |
39-
| appsecret | Secret access key of an app, which is obtained from app information. |
40-
| token_server | URL for the Huawei OAuth 2.0 service to obtain a token, please refer to [Generating an App-Level Access Token](https://developer.huawei.com/consumer/en/doc/development/parts-Guides/generating_app_level_access_token). |
41-
| push_open_url | URL for accessing HUAWEI Push Kit, please refer to [Sending Messages](https://developer.huawei.com/consumer/en/doc/development/HMS-References/push-sendapi). |
34+
| appid| App ID, which is obtained from the app information.|
35+
| appsecret | App secret, which is obtained from the app information.|
36+
| 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). |
37+
| 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). |
4238

4339
## Sample Code
4440

45-
#### 1. Send an Android data message.
46-
Code location: examples/sendDataMessage.java
41+
1. Send a data message to an Android app.
42+
File path: **examples/sendDataMessage.java**
4743

48-
#### 2. Send an Android notification message.
49-
Code location: examples/sendNotifyMessage.java
44+
. Send a notification message to an Android app.
45+
File path: **examples/sendNotifyMessage.java**
5046

51-
#### 3. Send a message by topic.
52-
Code location: examples/sendTopicMessage.java
47+
. Send a message by topic.
48+
File path: **examples/sendTopicMessage.java**
5349

54-
#### 4. Send a message by conditions.
55-
Code location: examples/sendConditionMessage.java
50+
. Send a message by condition.
51+
File path: **examples/sendConditionMessage.java**
5652

57-
#### 5. Send a message to a Huawei quick app.
58-
Code location: examples/sendInstanceAppMessage.java
53+
. Send a message to a Huawei quick app.
54+
File path: **examples/sendInstanceAppMessage.java**
5955

60-
#### 6. Send a message through the WebPush agent.
61-
Code location: examples/sendWebpushMessage.java
56+
. Send a message by WebPush.
57+
File path: **examples/sendWebpushMessage.java**
6258

63-
#### 7. Send a message through the APNs agent.
64-
Code location: examples/sendApnsMessage.java
59+
. Send a message by APNs.
60+
File path: **examples/sendApnsMessage.java**
6561

66-
#### 8. Send a test message.
67-
Code location: examples/sendTestMessage.java
62+
. Send a test message.
63+
File path: **examples/sendTestMessage.java**
6864

69-
## Question or issues
70-
If you want to evaluate more about HMS Core,
71-
[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.
65+
## Technical Support
66+
You can visit the [Reddit community](https://www.reddit.com/r/HuaweiDevelopers/) to obtain the latest information about HMS Core and communicate with other developers.
7267

73-
If you have questions about how to use HMS samples, try the following options:
74-
- [Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services) is the best place for any programming questions. Be sure to tag your question with
75-
`huawei-mobile-services`.
76-
- [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.
68+
If you have any questions about the sample code, try the following:
69+
- 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.
70+
- 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.
7771

78-
If you run into a bug in our samples, please submit an [issue](https://github.com/HMS-Core/hms-push-serverdemo-java/issues) to the Repository. Even better you can submit a [Pull Request](https://github.com/HMS-Core/hms-push-serverdemo-java/pulls) with a fix.
72+
If 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).
7973

8074
## License
81-
Pushkit Java sample is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
75+
The sample code is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).

README_ZH.md

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# 华为推送服务服务端Java示例代码
2-
[English](https://github.com/HMS-Core/hms-push-serverdemo-java) | 中文
2+
[English](README.md) | 中文
33

44
## 目录
55

@@ -9,69 +9,65 @@
99
* [配置](#配置)
1010
* [示例代码](#示例代码)
1111
* [授权许可](#授权许可)
12-
13-
14-
## 简介
1512

16-
Java示例代码对华为推送服务(HUAWEI Push Kit)服务端接口进行封装,包含丰富的示例程序,方便您参考或直接使用。
1713

18-
示例代码主要包括以下组成:
14+
## 简介
15+
16+
Java示例代码对华为推送服务(HUAWEI Push Kit)服务端接口进行封装,供您参考使用。
1917

18+
示例代码目录结构如下:
2019
| 包名 | 说明 |
2120
| ---- | ---- |
22-
| examples | 示例代码包,每个包都可以独立运行 |
23-
| messaging | 推送服务的服务端接口封装包 |
21+
| examples | 示例代码包 |
22+
| messaging | 服务端接口封装包 |
2423

2524
## 环境要求
2625

27-
推荐使用JDK 8.0及以上版本和IntelliJ IDEA。
28-
29-
## 安装
30-
配置好编译工具,将示例代码导入您的集成开发环境(IDE)中。
26+
推荐使用JDK 8.0及以上版本。
3127

3228
## 配置
3329

34-
请配置以下参数
30+
参数说明
3531

3632
| 参数 | 说明 |
3733
| ---- | ---- |
3834
| appid | 应用ID,从应用信息中获取 |
3935
| appsecret | 应用访问密钥,从应用信息中获取 |
40-
| token_server | 华为OAuth 2.0获取token的地址。具体请参考 [基于OAuth 2.0开放鉴权-客户端模式](https://developer.huawei.com/consumer/cn/doc/development/parts-Guides/generating_app_level_access_token). |
41-
| push_open_url | 推送服务的访问地址。具体请参考 [推送服务-下行消息](https://developer.huawei.com/consumer/cn/doc/development/HMS-References/push-sendapi). |
36+
| token_server | 华为OAuth 2.0获取token的地址。详情请参见 [基于OAuth 2.0开放鉴权-客户端模式](https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides/oauth2-0000001212610981#section128682386159?ha_source=hms1). |
37+
| push_open_url | 推送服务的访问地址。详情请参见 [推送服务-下行消息](https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides/android-server-dev-0000001050040110?ha_source=hms1). |
4238

4339
## 示例代码
4440

45-
#### 1. 发送Android透传消息
46-
代码位置:examples/sendDataMessage.java
41+
1. 发送Android透传消息
42+
文件目录:examples/sendDataMessage.java
4743

48-
#### 2. 发送Android通知栏消息
49-
代码位置:examples/sendNotifyMessage.java
44+
2. 发送Android通知栏消息
45+
文件目录:examples/sendNotifyMessage.java
5046

51-
#### 3. 基于主题发送消息
52-
代码位置:examples/sendTopicMessage.java
47+
3. 基于主题发送消息
48+
文件目录:examples/sendTopicMessage.java
5349

54-
#### 4. 基于条件发送消息
55-
代码位置:examples/sendConditionMessage.java
50+
4. 基于条件发送消息
51+
文件目录:examples/sendConditionMessage.java
5652

57-
#### 5. 向华为快应用发送消息
58-
代码位置:examples/sendInstanceAppMessage.java
53+
5. 向华为快应用发送消息
54+
文件目录:examples/sendInstanceAppMessage.java
5955

60-
#### 6. 基于WebPush代理发送消息
61-
代码位置:examples/sendWebpushMessage.java
56+
6. 基于WebPush代理发送消息
57+
文件目录:examples/sendWebpushMessage.java
6258

63-
#### 7. 基于APNs代理发送消息
64-
代码位置:examples/sendApnsMessage.java
59+
7. 基于APNs代理发送消息
60+
文件目录:examples/sendApnsMessage.java
6561

66-
#### 8. 发送测试消息
67-
代码位置:examples/sendTestMessage.java
62+
8. 发送测试消息
63+
文件目录:examples/sendTestMessage.java
6864

6965
## 技术支持
7066
如果您对HMS Core还处于评估阶段,可在[Reddit社区](https://www.reddit.com/r/HuaweiDevelopers/)获取关于HMS Core的最新讯息,并与其他开发者交流见解。
7167

7268
如果您对使用HMS示例代码有疑问,请尝试:
73-
- 开发过程遇到问题上[Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services),在`huawei-mobile-services`标签下提问,有华为研发专家在线一对一解决您的问题。
74-
-[华为开发者论坛](https://developer.huawei.com/consumer/cn/forum/blockdisplay?fid=18) HMS Core板块与其他开发者进行交流。
69+
- 开发过程遇到问题上[Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services?tab=Votes),在`huawei-mobile-services`标签下提问,有华为研发专家在线一对一解决您的问题。
70+
-[华为开发者论坛](https://developer.huawei.com/consumer/cn/forum/blockdisplay?fid=18?ha_source=hms1) HMS Core板块与其他开发者进行交流。
7571

7672
如果您在尝试示例代码中遇到问题,请向仓库提交[issue](https://github.com/HMS-Core/hms-push-serverdemo-java/issues),也欢迎您提交[Pull Request](https://github.com/HMS-Core/hms-push-serverdemo-java/pulls)
7773

0 commit comments

Comments
 (0)