Push Notifications

CodeMash Push Notifications service allows you to push mobile notifications to your users. All notifications queuing and management is accessible through the dashboard. Using API methods you can register devices, push messages and more.

To start using push notifications service and it's API methods, you firstly need to enable push notifications service in your CodeMash dashboard.

Using SDK

If you decide to use one of our provided SDK, the following code shows how to initialize notifications service.

.NET
Node
.NET
var projectId = Guid.Parse("{YOUR_PROJECT_ID}");
var apiKey = "{YOUR_SECRET_KEY}";
var client = new CodeMashClient(apiKey, projectId);
var pushService = new CodeMashPushService(client);
Node

Example

The following are the examples of push notifications SDK using different languages and frameworks.

.NET
Node
.NET
using System;
using CodeMash.Client;
using CodeMash.Notifications.Push.Services;
using Isidos.CodeMash.ServiceContracts;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
// 1. Get your Project ID and Secret Key
var projectId = Guid.Parse("{YOUR_PROJECT_ID}");
var apiKey = "{YOUR_SECRET_KEY}";
// 2. Create a general client for API calls
var client = new CodeMashClient(apiKey, projectId);
// 3. Create a service object
var pushService = new CodeMashPushService(client);
// 4. Call an API method
var response = pushService.SendPushNotification(
new SendPushNotificationRequest
{
TemplateId = Guid.Parse("{TEMPLATE_ID}"),
Users = new List<Guid> { Guid.Parse("{USER_ID}") }
}
);
}
}
}
Node

Working with Push Service

The following links explore the usage of push notifications service: