Git Product home page Git Product logo

hms-core / hms-push-serverdemo-java Goto Github PK

View Code? Open in Web Editor NEW
43.0 15.0 32.0 147 KB

Java sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs for your reference or usage.

Home Page: https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/push-introduction

License: Apache License 2.0

Java 100.00%
huawei push hms java push-notifications sendmessage sever

hms-push-serverdemo-java's Introduction

HMS Core Push Kit Sample Code (Java)

English | δΈ­ζ–‡

Contents

Introduction

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.

Environment Requirements

JDK 8.0 or later is recommended.

Configuration

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.

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

Technical Support

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.

License

The sample code is licensed under Apache License 2.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.