Code Monkey home page Code Monkey logo

php-library2's Introduction

Airship PHP Library

PHP library for use with the Airship REST API for sending notifications. Supports iOS, Android, Amazon, and Windows.

Airship is no longer actively developing this library, but will respond to feature requests, issues, and pull requests when they are submitted via https://support.airship.com. This library is provided as sample code, and Airship makes no guarantees as to completeness or regularity of updates. However, we do welcome pull requests with a signed contribution agreement <https://docs.google.com/forms/d/e/1FAIpQLScErfiz-fXSPpVZ9r8Di2Tr2xDFxt5MgzUel0__9vqUgvko7Q/viewform>__.

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\iosChannel("Insert your iOS channel here!"))
        ->setNotification(P\notification("Hello from PHP"))
        ->setDeviceTypes(P\deviceTypes("ios"))
        ->send();
} catch (AirshipException $e) {
    print_r($e);
}

Resources

php-library2's People

Contributors

adeelx avatar andrescamera avatar aschuman0 avatar dcolish avatar devinsmythe avatar jahdeh avatar jenniferjsmmiller avatar julien-c avatar mhooge avatar pdxmele avatar robotadam avatar row-b avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-library2's Issues

Monolog in version 0.1.3

Hi,

I see that the Monolog version is already "relaxed" on the master branch but would it be possible to create a new version tag with this change? I'm currently pointing Composer to master which I'd rather not do for to long.

Thanks in advance.

Rich text message

How can I set rich text message using API? In PushRequest.php, there are setAudience, setNotification, setDeviceTypes, setOptions, but no setMessage.

Why is requested PHP >= 5.4.14?

Why such a high requirement? Moreover, I just tried your library on my server with PHP 5.3 and it worked flawlessly (I just sent a normal push notification with pusher.php from your example folder).

Send push to multiple device types

Hi,
We want to send push messages to our subscribers and we have captured their device tokens and device types. Now on certain events we want to send them a push message. Do I need to pass seprate array of each device type to push method or I can send all device tokens at a time and library will take care of genrating playload as per device type?
Please advice.

Thank you,
Vaibhav

Support for Monolog 2.*

Developing an app using PHP framework Laravel version 8 which has a requirement of Monolog 2.

There is currently a conflict together with this library as it requires Monolog 1.*.

HTTP request lib

Hi,

is your choice of HTTP request library written in stone?

I'd like to implement "fire'n'forget", non-blocking calls to your API (your server being sometimes, how would I put it... not blazing fast ๐Ÿ˜„)

Guzzle would fit the bill as it has an Async plugin.

Would you consider moving to Guzzle?

Thanks!

Proxy CONNECT aborted

Hello,

I'm trying to send a simple push notification, but I get this error. After some debugging, I found out that the problem comes from nategood/httpful library used here.

Here is the issue with more details:
nategood/httpful#269

Issue send Android Notification

Hi,

I'm having some issue sending a push to an Android device.
I'm getting:

Warning: preg_match(): No ending delimiter '^' found .......

Adding an slash to Audience.php > UUID_FORMAT fixes it:

const UUID_FORMAT = "/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/";

So I don't know if it's a bug or I'm making sth wrong.

Thanks in advanced

iOS sound

I'm trying to send push notificacions with a sound using the PHP.
This is what I do:

setNotification(P\ios("Hello!", $badge="+1", $sound="default", false,
null))

Even I'm using the default sound the notification doesn't play it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.