superbalist/php-localytics-push

A PHP client for sending push notifications via the Localytics Push Notification service

1.0.0 2016-10-19 08:08 UTC

This package is auto-updated.

Last update: 2024-04-11 23:40:52 UTC


README

A PHP client for sending push notifications via the Localytics Push Notification service

Author Build Status StyleCI Software License Packagist Version Total Downloads

Installation

composer require superbalist/php-localytics-push

Integrations

Want to get started quickly? Check out some of these integrations:

Usage

$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);