https://github.com/tbertuzzi/appcenter.helpers
:package: Helpers to get data from Analitycs, Errors and Send Push Notification to the AppCenter
https://github.com/tbertuzzi/appcenter.helpers
Last synced: 6 months ago
JSON representation
:package: Helpers to get data from Analitycs, Errors and Send Push Notification to the AppCenter
- Host: GitHub
- URL: https://github.com/tbertuzzi/appcenter.helpers
- Owner: TBertuzzi
- Created: 2019-02-21T20:05:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-11T18:06:23.000Z (over 6 years ago)
- Last Synced: 2025-04-13T03:16:40.863Z (6 months ago)
- Language: C#
- Homepage:
- Size: 27.3 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AppCenter.Helpers
**THIS PACKAGE IS BETA**
Helpers to get data from Analitycs, Errors and Send Push Notification to the AppCenter
###### This is the component, works on .NET Core and.NET Framework
**Info**
|Code Quality|Build|Nuget|
| ------------------- | ------------------- | :------------------: |
|[](https://app.codacy.com/app/TBertuzzi/AppCenter.Helpers?utm_source=github.com&utm_medium=referral&utm_content=TBertuzzi/AppCenter.Helpers&utm_campaign=Badge_Grade_Dashboard)||[](https://www.nuget.org/packages/AppCenter.Helpers/)|**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
```csharp
var config = new Config()
{
AppName = "your app name",
OwnerName = "your owner name",
Token = "appcenter token"
};
```To get a token [click here](https://docs.microsoft.com/en-us/appcenter/api-docs/)
**Push Notification**
To send a notification simply fill in the Notification object and call the SendPushNotification
```csharp
var notificacao = new Notification
{
NotificationTarget = new NotificationTarget
{
Type = "devices_target",
Devices = new List(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
```csharp
var resultList = push.GetPushNotifications();foreach (var item in resultList.Value.ResultContent)
{
Console.WriteLine($"Item {item}");
}
```To configure Push Notification in appcenter [click here](https://docs.microsoft.com/en-us/appcenter/push/)
**Analytics** (In development)
Get all events through GetEvents method
```csharp
var analytics = new Analytics.Analytics(config);
var result = analytics.GetEvents();
```**Analytics** (In development)
Get all error groups through GetErrorGroups method
```csharp
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 :)