klaussilveira/urbanairship-php

PHP 库,提供了一种简单的方式与 Urban Airship 服务进行通信

0.1.0 2013-01-23 20:39 UTC

This package is not auto-updated.

Last update: 2024-09-22 03:03:45 UTC


README

Build Status

Urban Airship PHP 是一个即插即用的库,它提供了一种简单的方式将 Urban Airship 服务集成到您的 Web 应用程序中。它抽象了设备和通知,以提供一致而优雅的界面来处理推送通知、批量推送、广播、设备注册等。

作者和贡献者

许可协议

新 BSD 许可协议

支持

  • iOS、Blackberry 设备注册/停用
  • Android、iOS、Blackberry 推送通知和广播
  • Android、iOS、Blackberry 批量推送

待办事项

  • 丰富的推送 API
  • Feed API
  • 订阅 API

使用方法

该库非常易于使用。您只需设置客户端

<?php

use UrbanAirship\Client;
use UrbanAirship\Push\AppleNotification;
use UrbanAirship\Device\AppleDevice;

$client = new Client('your_application_key', 'your_master_secret');

// Simple broadcast
$notification = new AppleNotification();
$notification->setAlert('Hey dude!');
$notification->setBadge(1);
$client->push($notification);

// Simple notification, with device
$device = new AppleDevice('FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660');
$device->setAlias('Luke Skywalker')->addTag('republic')->addTag('pilot');

$notification = new AppleNotification();
$notification->addDevice($device);
$notification->setAlert('Hey dude!');
$notification->setBadge(1);
$client->push($notification);

有关更多信息示例,请查看测试套件。