GithubHelp home page GithubHelp logo

almliden / hms-push-serverdemo-csharp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hms-core/hms-push-serverdemo-csharp

0.0 0.0 0.0 117 KB

C# 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

C# 100.00%

hms-push-serverdemo-csharp's Introduction

HMS Pushkit Csharp Severdemo

Table of Contents

Introduction

C# sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs for your reference or usage. The following table describes folders of C# sample code:

Folder Description
AGConnectAdmin Class library encapsulated for HUAWEI Push Kit.
AGConnectAdmin.Examples Examples of using the Class library.

The following table defines main classes in the sample code:

Class Description
AppOptions App configurations.
AGConnectApp App.
AGConnectMessaging HUAWEI Push Kit API calling methods.
Message Body of a message.

Installation

  1. Decompress the sample code.
  2. Copy the decompressed AGConnectAdmin project to a proper location in your app's Visual Studio Solution, and then reference the project in your app project.
  3. Refer to the example codes to find out how to use classes in AGConnectAdmin project.

Configuration

The following table describes parameters of the AppOptions class:

Parameter Description
ClientId App ID, which is obtained from app information.
ClientSecret Secret access key of an app, which is obtained from app information.
LoginUri URL for the Huawei OAuth 2.0 service to obtain a token, please refer to Generating an App-Level Access Token.
ApiBaseUri URL for accessing HUAWEI Push Kit, please refer to Sending Messages.

Supported Environment

Sample code projects need to be opened by Visual Studio 2017 or a later version and supports the following frameworks:

  • .NET Framework 4.5+
  • .NET Standard 2.0+

Sample Code

All sample code are in AGConnectAdmin.Examples project included below use cases.

  1. Send an Android data message.

    AGConnectAdmin.Examples/Example.SendDataMessage.cs

  2. Send an Android notification message.

    AGConnectAdmin.Examples/Example.SendAndroidMessage.cs

  3. Send a message by topic.

    AGConnectAdmin.Examples/Example.SendTopicMessage.cs

  4. Send a message by conditions.

    AGConnectAdmin.Examples/Example.SendConditionMessage.cs

  5. Send a message to a Huawei quick app.

    AGConnectAdmin.Examples/Example.SendInstanceAppMessage.cs

  6. Send a message through the WebPush agent.

    AGConnectAdmin.Examples/Example.SendWebpushMessage.cs

  7. Send a message through the APNs agent.

    AGConnectAdmin.Examples/Example.SendApnsMessage.cs

  8. Send a test message.

    AGConnectAdmin.Examples/Example.SendTestMessage.cs

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 Csharp sample codes are licensed under the Apache License, version 2.0.

hms-push-serverdemo-csharp's People

Contributors

hmspushkit avatar mike-mei avatar

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.