3 Star 11 Fork 4

华为移动服务 / hms-push-serverdemo-java

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

HMS Pushkit Java Severdemo

English | 中文

Table of Contents

Introduction

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.

Supported Environments

For HUAWEI Push Kit, JDK 8.0 or later and IntelliJ IDEA are recommended.

Installation

Configure your build tool to import the sample code into your IDE.

Configuration

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.

Sample Code

1. Send an Android data message.

Code location: examples/sendDataMessage.java

2. Send an Android notification message.

Code location: examples/sendNotifyMessage.java

3. Send a message by topic.

Code location: examples/sendTopicMessage.java

4. Send a message by conditions.

Code location: examples/sendConditionMessage.java

5. Send a message to a Huawei quick app.

Code location: examples/sendInstanceAppMessage.java

6. Send a message through the WebPush agent.

Code location: examples/sendWebpushMessage.java

7. Send a message through the APNs agent.

Code location: examples/sendApnsMessage.java

8. Send a test message.

Code location: examples/sendTestMessage.java

Question or issues

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:

  • Stack Overflow is the best place for any programming questions. Be sure to tag your question with huawei-mobile-services.
  • Huawei Developer Forum HMS Core Module is great for general questions, or seeking recommendations and opinions.

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.

License

Pushkit Java sample is licensed under the Apache License, version 2.0.

Repository Comments ( 1 )

Sign in to post a comment

About

华为推送服务服务端Java示例代码,对华为推送的服务端接口进行封装,包含丰富的示例程序,方便您参考或直接使用。 expand collapse
Java
Apache-2.0
Cancel

Releases

No release

hms-push-serverdemo-java

Contributors

All

Activities

Load More
can not load any more
Java
1
https://gitee.com/hms-core/hms-push-serverdemo-java.git
git@gitee.com:hms-core/hms-push-serverdemo-java.git
hms-core
hms-push-serverdemo-java
hms-push-serverdemo-java
master

Search

161121 f78d6d6f 1850385 154831 86f8c370 1850385