English | 中文
Java sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs for your reference or usage.
The following table describes packages of Java sample code.
|examples||Sample code packages. Each package can run independently.|
|messaging||Package where APIs of the HUAWEI Push Kit server are encapsulated.|
For HUAWEI Push Kit, JDK 8.0 or later and IntelliJ IDEA are recommended.
Configure your build tool to import the sample code into your IDE.
The following table lists parameters to be set.
|appid||App ID, which is obtained from app information.|
|appsecret||Secret access key of an app, which is obtained from app information.|
|token_server||URL for the Huawei OAuth 2.0 service to obtain a token, please refer to Generating an App-Level Access Token.|
|push_open_url||URL for accessing HUAWEI Push Kit, please refer to Sending Messages.|
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
If you want to evaluate more about HMS Core, r/HMSCore on Reddit is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.
If you have questions about how to use HMS samples, try the following options:
Pushkit Java sample is licensed under the Apache License, version 2.0.
：Code submit frequency
：React/respond to issue & PR etc.
：Well-balanced team members and collaboration
：Recent popularity of project
：Star counts, download counts etc.