albo-vieira/push-notification

Send notifications for device mobiles

dev-master 2016-08-25 14:51 UTC

This package is not auto-updated.

Last update: 2024-09-26 02:07:23 UTC


README

Send push-notifications for Android(with GCM) and IOS.

Install

composer require albo-vieira/push-notification dev-master 

Usage

Copy the file push_config and require it in your project, set the options as you need.

include('push_config.php');

ANDROID

$result = $android = PushNotification\PushFactory::getInstance('android', $pushConfig)
    ->withTokens([
        'TOKENS',
    ])
    ->withNotification(['title' => 'title', 'text' => 'Texto'])
    ->send();
print_r($result);  

IOS

$result = $ios = PushNotification\PushFactory::getInstance('ios', $pushConfig)
    ->withTokens(['TOKENS'])
    ->withNotification(['alert' => 'Texto', 'badge' => 1, 'sound' => 'default'])
    ->send();
print_r($result);