hamed-shirbandi / Pushe.co

Send push notification by pushe.co based on .NET Standard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is this ?

Simple library to send push notification by pushe.co

Article in persian

Install via NuGet

To install Pushe.co, run the following command in the Package Manager Console

pm> Install-Package Pushe.co

You can also view the package page on NuGet.

How to use ?

1- install package from nuget

2- add required services Startup class as below :

               services.AddPushe(options=>
                {
                  options.AccessToken = "YOUR_PUSHE_ACCESS_TOKEN";
                  options.Applications = "APP_Name1,APP_Name2";
                  
                 });

3- send push notification by using IPusheService:

               var pusheService = serviceProvider.GetRequiredService<IPusheService>();

                var push = new PusheJsonModel
                {
                    Notification = new Notification
                    {
                        Title = "test by console app",
                        Content = "this is a test by console app",

                    },
                    Filter = new Filter
                    {
                        //by pushe id
                        Pushe_Id = new string[] { "pid_31b1-33d3-30" },
                    }
                };

                await pusheService.SendAsync(push);

See more example in source.

To Do

-Add MVC example

About

Send push notification by pushe.co based on .NET Standard


Languages

Language:C# 100.0%