ApollosProject / Apollos.OneSignal.RestAPIv3.Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Apollos.OneSignal.RestApiv3.Client

A General purpose REST Api Client written in C# language for the OneSignal API v3

Install via NuGet

PM> Install-Package Apollos.OneSignal.RestAPIv3.Client

Apollos.OneSignal.RestApiv3.Client package targets both .NET standard 2.0 and .NET Framework 4.5.2.

How to use

var client = new OneSignalClient(""); // Use your Api Key

var options = new NotificationCreateOptions
{
    AppId = new Guid(""),   // Use your AppId
    IncludePlayerIds = new List<string>()
    {
        "00000000-0000-0000-0000-000000000000" // Use your playerId
    },
    // ... OR ...
    IncludeExternalUserIds = new List<string>()
    {
        "000000" // whatever your custom id is
    }
};
options.Headings.Add(LanguageCodes.English, "New Notification!");
options.Contents.Add(LanguageCodes.English, "This will push a real notification directly to your device.");

client.Notifications.Create(options);

Official OneSignal API Documentation

OneSignal Server API Documentation

This is a fork of Alegrowin's OneSignal.RestAPIv3.Client repository.

About

License:Apache License 2.0


Languages

Language:C# 100.0%