English | 中文
- Introduction
- Environment Requirements
- Installation
- Configuration
- Sample Code
- Technical Support
- License
The sample code for Java encapsulates the server-side APIs of Push Kit, for your reference or direct use.
The following table describes packages of Java sample code.
Package | Description |
---|---|
examples | Sample code packages. |
messaging | Package where Push Kit server APIs are encapsulated. |
JDK 8.0 or later is recommended.
Set the following parameters.
Parameter | Description |
---|---|
appid | App ID, which is obtained from the app information. |
appsecret | App secret, which is obtained from the app information. |
token_server | URL for Huawei OAuth 2.0 to obtain a token. For details, please refer to OAuth 2.0-based Authentication. |
push_open_url | Access address of Push Kit. For details, please refer to Downlink Message Sending. |
Code location: examples/SendDataMessage.java
Code location: examples/SendNotifyMessage.java
Code location: examples/SendTopicMessage.java
Code location: examples/SendConditionMessage.java
Code location: examples/SendInstanceAppMessage.java
Code location: examples/SendWebpushMessage.java
Code location: examples/SendApnsMessage.java
Code location: examples/SendTestMessage.java
You can visit the Reddit community to obtain the latest information about HMS Core and communicate with other developers.
If you have any questions about the sample code, try the following:
- Visit Stack Overflow, submit your questions, and tag them with
huawei-mobile-services
. Huawei experts will answer your questions. - Visit the HMS Core section in the HUAWEI Developer Forum and communicate with other developers.
If you encounter any issues when using the sample code, submit your issues or submit a pull request.
The sample code is licensed under Apache License 2.0.