adintegra / php-library2

Urban Airship PHP Library (beta)

Home Page:http://docs.urbanairship.com/reference/libraries/php/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Urban Airship PHP Library (Beta)

PHP library for use with the Urban Airship API for sending push notifications. Supports iOS, Android, and Blackberry.

Requirements

PHP >= 5.3

Dependencies

  • Composer
  • Httpful
  • Monolog

Development Dependencies

PHPUnit

Example Usage

<?php

require_once 'vendor/autoload.php';

use UrbanAirship\Airship;
use UrbanAirship\AirshipException;
use UrbanAirship\UALog;
use UrbanAirship\Push as P;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

UALog::setLogHandlers(array(new StreamHandler("php://stdout", Logger::DEBUG)));

$airship = new Airship("<app key>", "<master secret>");

try {
    $response = $airship->push()
        ->setAudience(P\all)
        ->setNotification(P\notification("Hello from php"))
        ->setDeviceTypes(P\all)
        ->send();
} catch (AirshipException $e) {
    print_r($e);
}

Resources

About

Urban Airship PHP Library (beta)

http://docs.urbanairship.com/reference/libraries/php/

License:Other


Languages

Language:PHP 100.0%