Boxcar Notifications API PHP wrapper
A Boxcar API wrapper for sending notifications to a Boxcar account without any dependencies except the cURL library., (*1)
, (*2)
, (*3)
Installing
The recommended way to install is though Composer., (*4)
{
"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, (*5)
'secret_access_token' in the above example. Your access token can be found in Boxcar global setting pane (Not the registered Boxcar email address)., (*6)
Title, (*7)
'Message title' in the above example. Title for the notification. Max size is 255 chars., (*8)
Content, (*9)
'<b>Bold</b> content text.' in the above example. Content of the notification. Can be text or HTML. Max size is 4 Kb., (*10)
Source name, (*11)
'ACME' in the above example. This is a short source name to show in inbox. Defaults to "Custom notification" if omitted., (*12)
Sound, (*13)
'notifier-1' in the above example. General sound is used if omitted. Please find list of supported sounds below., (*14)
Icon URL, (*15)
'http://new.boxcar.io/images/rss_icons/boxcar-64.png' in the above example. Icon to be displayed in the Boxcar inbox., (*16)
open URL, (*17)
'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., (*18)
Supported sounds
The following sounds can be used., (*19)
- 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., (*20)
Disclaimer
I am not affiliated with Boxcar in any way., (*21)