A PHP client for sending push notifications via the Localytics Push Notification service
composer require superbalist/php-localytics-push
Want to get started quickly? Check out some of these integrations:
$client = new GuzzleHttp\Client();
$appID = 'your-app-id';
$apiKey = 'your-api-key';
$apiSecret = 'your-api-secret';
$localytics = new \Superbalist\LocalyticsPush\LocalyticsPush($client, $appID, $apiKey, $apiSecret);
$message = [
'target' => [
'profile' => [
'criteria' => [
[
'key' => '$email',
'scope' => 'Organization',
'type' => 'string',
'op' => 'in',
'values' => [
'matthew@superbalist.com',
]
]
],
'op' => 'and',
],
],
'alert' => [
'title' => 'Message Title',
'body' => 'This is my message content!',
]
];
$response = $localytics->pushMessage('profile', $message);