Simple library to send push notification by pushe.co
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.
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.
-Add MVC example