THIS PACKAGE IS BETA
Helpers to get data from Analitycs, Errors and Send Push Notification to the AppCenter
Info
Code Quality | Build | Nuget |
---|---|---|
Platform Support
RepositoryHelpers is a .NET Standard 2.0 library.
Config
Use the config class to configure the name, owner, and token of your app in the center app
var config = new Config()
{
AppName = "your app name",
OwnerName = "your owner name",
Token = "appcenter token"
};
To get a token click here
Push Notification
To send a notification simply fill in the Notification object and call the SendPushNotification
var notificacao = new Notification
{
NotificationTarget = new NotificationTarget
{
Type = "devices_target",
Devices = new List<string>(new string[] { "00000000-0000-0000-0000-000000000001" }) //exemplo
},
NotificationContent = new NotificationContent
{
Name = "MyAppName",
Title = "Notification Title",
Body = "Notification Body",
}
};
var push = new PushNotification(config);
var result = push.SendPushNotification(notificacao);
To get all the notifications just use the method below
var resultList = push.GetPushNotifications();
foreach (var item in resultList.Value.ResultContent)
{
Console.WriteLine($"Item {item}");
}
To configure Push Notification in appcenter click here
Analytics (In development)
Get all events through GetEvents method
var analytics = new Analytics.Analytics(config);
var result = analytics.GetEvents();
Analytics (In development)
Get all error groups through GetErrorGroups method
var errors = new Errors.Errors(config);
var result = errors.GetErrorGroups();
App Center APIs are being implemented bit by bit. Pullrequests are welcome but should follow the existing pattern :)