2017 © Pedro Peláez
 

library php-appboy

A PHP client for sending push notifications via the Appboy API

image

superbalist/php-appboy

A PHP client for sending push notifications via the Appboy API

  • Monday, July 3, 2017
  • by matthewgoslett
  • Repository
  • 22 Watchers
  • 1 Stars
  • 209 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

php-appboy

A PHP client for sending push notifications via the Appboy API, (*1)

Author Build Status StyleCI Software License Packagist Version Total Downloads, (*2)

Installation

composer require superbalist/php-appboy

Usage

use GuzzleHttp\Client;
use Superbalist\Appboy\Appboy;
use Superbalist\Appboy\NotificationBuilder;
use Superbalist\Appboy\ScheduledNotificationBuilder;
use Superbalist\Appboy\Messages\AndroidMessageBuilder;
use Superbalist\Appboy\Messages\AppleMessageBuilder;

$client = new Client();
$appboy = new Appboy($client, 'your-app-group-id');

// send a push message
$appboy->sendMessage(
    (new NotificationBuilder())
        ->toUsers([1, 2])
        ->setCampaign('my_campaign')
        ->ignoreFrequencyCapping()
        ->setSubscriptionState('opted_in')
        ->withMessages([
            'apple_push' => (new AppleMessageBuilder())
                ->setAlert('Hello World!')
                ->setSound('custom_sound')
                ->withExtraAttributes(['is_test' => true])
                ->setCategory('shipping_notification')
                ->expiresAt(new \DateTime('2017-05-29 10:00:00', new \DateTimeZone('Africa/Johannesburg')))
                ->setUri('http://superbalist.com')
                ->setMessageVariation('group_a')
                ->setAsset('file://image.jpg', 'jpg')
                ->build(),
            'android_push' => (new AndroidMessageBuilder())
                ->setAlert('Hello World!')
                ->setTitle('Message Title')
                ->withExtraAttributes(['is_test' => true])
                ->setMessageVariation('group_a')
                ->setPriority(2)
                ->setCollapseKey('shipment_1234')
                ->setSound('custom_sound')
                ->setUri('http://superbalist.com')
                ->setSummaryText('This is a summary line')
                ->setTimeToLive(60)
                ->setNotificationId(18456)
                ->setPushIconImageUrl('http://link/to/asset.jpg')
                ->setAccentColour(16777215)
                ->build(),
        ])
        ->build()
);

// schedule a push message
$appboy->scheduleMessage(
    (new ScheduledNotificationBuilder())
        ->toUsers([1, 2])
        ->setCampaign('my_campaign')
        ->ignoreFrequencyCapping()
        ->setSubscriptionState('opted_in')
        ->withMessage(
            'apple_push',
            (new AppleMessageBuilder())
                ->setAlert('Hello World!')
                ->setSound('custom_sound')
                ->withExtraAttributes(['is_test' => true])
                ->setCategory('shipping_notification')
                ->expiresAt(new \DateTime('2017-05-29 10:00:00', new \DateTimeZone('Africa/Johannesburg')))
                ->setUri('http://superbalist.com')
                ->setMessageVariation('group_a')
                ->setAsset('file://image.jpg', 'jpg')
                ->build()
        )
        ->sendsAt(new \DateTime('2017-05-29 10:00:00', new \DateTimeZone('Africa/Johannesburg')))
        ->build()

The Versions

03/07 2017

dev-master

9999999-dev

A PHP client for sending push notifications via the Appboy API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Superbalist.com a division of Takealot Online (Pty) Ltd

29/06 2017

1.0.1

1.0.1.0

A PHP client for sending push notifications via the Appboy API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Superbalist.com a division of Takealot Online (Pty) Ltd

30/05 2017

1.0.0

1.0.0.0

A PHP client for sending push notifications via the Appboy API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Superbalist.com a division of Takealot Online (Pty) Ltd