Push
Send personal or bulk push notifications to your clients. Schedule them, plan to send by client time zone, and have different languages over each message you deliver.
Using SDK
var projectId = Guid.Parse("{YOUR_PROJECT_ID}");
var apiKey = "{YOUR_SECRET_KEY}";
var client = new CodeMashClient(apiKey, projectId);
var pushService = new CodeMashPushService(client);use Codemash\CodemashClient;
use Codemash\CodemashPushNotification;
class CodemashService
{
protected CodemashPushNotification $codemashPushNotification;
public function __construct()
{
$secretKey = '{YOUR_SECRET_KEY}';
$projectId = '{YOUR_PROJECT_ID}';
$client = new CodemashClient($secretKey, $projectId);
$codemashPushNotification = new CodemashPushNotification($client);
}
}Example
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}") }
}
);
}
}
}Working with Push Service
Push Notifications APILast updated