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.
Package | Description |
---|---|
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.
Parameter | Description |
---|---|
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:
huawei-mobile-services
.If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.
Pushkit Java sample is licensed under the Apache License, version 2.0.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。