zortje/boxcar-notifications-php

A Boxcar api wrapper for sending notifications to a Boxcar account

1.0.0 2015-10-03 11:32 UTC

This package is not auto-updated.

Last update: 2024-04-13 16:01:31 UTC


README

A Boxcar API wrapper for sending notifications to a Boxcar account without any dependencies except the cURL library.

Packagist Travis Code Coverage Scrutinizer Dependency Status Packagist

SensioLabsInsight

Installing

The recommended way to install is though Composer.

{
    "require": {
        "zortje/boxcar-notifications-php": "~1.0"
    }
}

Usage

$boxcar = new \Zortje\BoxcarNotifications\Boxcar('secret_access_token');

$boxcar->setSourceName('ACME');
$boxcar->setSound('notifier-1');
$boxcar->setIconUrl('http://new.boxcar.io/images/rss_icons/boxcar-64.png');
$boxcar->setOpenUrl('http://maps.google.com/maps?q=cupertino');

$notification = new \Zortje\BoxcarNotifications\Notification('Message title', '<b>Bold</b> content text.');

$boxcar->push($notification);

Access token

'secret_access_token' in the above example. Your access token can be found in Boxcar global setting pane (Not the registered Boxcar email address).

Title

'Message title' in the above example. Title for the notification. Max size is 255 chars.

Content

'<b>Bold</b> content text.' in the above example. Content of the notification. Can be text or HTML. Max size is 4 Kb.

Source name

'ACME' in the above example. This is a short source name to show in inbox. Defaults to "Custom notification" if omitted.

Sound

'notifier-1' in the above example. General sound is used if omitted. Please find list of supported sounds below.

Icon URL

'http://new.boxcar.io/images/rss_icons/boxcar-64.png' in the above example. Icon to be displayed in the Boxcar inbox.

open URL

'http://maps.google.com/maps?q=cupertino' in the above example. If defined, Boxcar will redirect the receiver to this url when he/she opens the notification from the Notification Center.

Supported sounds

The following sounds can be used.

  • beep-crisp
  • beep-soft
  • bell-modern
  • bell-one-tone
  • bell-simple
  • bell-triple
  • bird-1
  • bird-2
  • boing
  • cash
  • clanging
  • detonator-charge
  • digital-alarm
  • done
  • echo
  • flourish
  • harp
  • light
  • magic-chime
  • magic-coin
  • notifier-1
  • notifier-2
  • notifier-3
  • orchestral-long
  • orchestral-short
  • score
  • success
  • up

Acknowledgement

Built by following the API specs provided in this Boxcar help article.

Disclaimer

I am not affiliated with Boxcar in any way.