Code Monkey home page Code Monkey logo

hms-push-serverdemo-csharp's Introduction

HMS Core Push Kit Sample Code (C#)

English | 中文

Contents

Introduction

The sample code for C# encapsulates the server-side APIs of Push Kit, for your reference or direct use.

The following table describes folders of C# sample code.

Folder Description
AGConnectAdmin Class library where Push Kit server APIs are encapsulated.
AGConnectAdmin.Examples Class library usage examples.

The following table describes main classes used in the sample code.

Class Name Description
AppOptions App-related configuration.
AGConnectApp App.
AGConnectMessaging Push Kit API calling methods.
Message Message body.

Installation

  1. Decompress the sample code.
  2. Copy AGConnectAdmin to a proper position in your Visual Studio solution and reference the corresponding assembly in your project.
  3. Use the classes in AGConnectAdmin by referring to the sample code.

Configuration

The following table describes the parameters related to the AppOptions class.

Parameter Description
ClientId App ID, which is obtained from the app information.
ClientSecret App secret, which is obtained from the app information.
LoginUri URL for Huawei OAuth 2.0 to obtain a token. For details, please refer to OAuth 2.0-based Authentication.
ApiBaseUri Access address of Push Kit. For details, please refer to Downlink Message Sending.

Environment Requirements

The demo projects need to be opened using Visual Studio 2017 or a later version. The following framework versions are supported:

  • .NET Framework 4.5 or later
  • .NET Standard 2.0 or later

Sample Code

AGConnectAdmin.Examples provides all sample code and corresponding functions.

  1. Send an Android data message. Code location: SendDataMessage.cs

  2. Send an Android notification message. Code location: SendAndroidMessage.cs

  3. Send a message by topic.Code location: SendTopicMessage.cs

  4. Send a message by conditions. Code location: SendConditionMessage.cs

  5. Send a message to a Huawei quick app. Code location: SendInstanceAppMessage.cs

  6. Send a message through the WebPush agent. Code location: SendWebpushMessage.cs

  7. Send a message through the APNs agent. Code location: SendApnsMessage.cs

  8. Send a test message. Code location: SendTestMessage.cs

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.

hms-push-serverdemo-csharp's People

Contributors

hmspushkit avatar mike-mei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hms-push-serverdemo-csharp's Issues

Batch Send支援

这个SDK不支持类似firebase batch send 的 SendAllAsync(IEnumerable message)?
image

Inquiry Regarding Missing Package on NuGet

Issue:
I am currently working with the Huawei AGConnectAdmin library, and I noticed that there is no corresponding NuGet package available for easy integration into projects. I have included the AGConnectAdmin.dll file in my project manually, but having an official NuGet package would simplify the integration process for many developers.

Questions:

  1. Is there an official plan to publish the AGConnectAdmin library as a NuGet package?
  2. If yes, what is the estimated timeline for the availability of the NuGet package?
  3. If no, are there alternative recommended methods for managing dependencies and integrating the AGConnectAdmin library into projects?

I appreciate your assistance in providing information about the availability of a NuGet package for the AGConnectAdmin library. This would greatly enhance the development experience for Huawei developers.

Thank you.

Demo 发送的通知栏消息没有声音,没有横幅

我尝试了demo的通知栏消息。

  1. 没有提示声音
  2. 亮屏情况,没有通知展示
  3. 锁屏情况没有横幅

使用官网的测试页发送都正常。
请问,我们的SDK 要怎么样设置可以有这些效果。

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.