An open API service indexing awesome lists of open source software.

https://github.com/webwarejp/notificationhubs-rest-php

Push Notification Library for Microsoft Azure Notification Hub
https://github.com/webwarejp/notificationhubs-rest-php

Last synced: 2 months ago
JSON representation

Push Notification Library for Microsoft Azure Notification Hub

Awesome Lists containing this project

README

        

# Notification Hubs REST wrapper for PHP

[![Build Status](https://travis-ci.org/webwarejp/notificationhubs-rest-php.svg?branch=master)](https://travis-ci.org/webwarejp/notificationhubs-rest-php)
[![StyleCI](https://styleci.io/repos/32438522/shield?branch=master)](https://styleci.io/repos/32438522)
[![Build Status](https://scrutinizer-ci.com/g/webwarejp/notificationhubs-rest-php/badges/build.png?b=master)](https://scrutinizer-ci.com/g/webwarejp/notificationhubs-rest-php/)
[![Code Rating](https://scrutinizer-ci.com/g/webwarejp/notificationhubs-rest-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/webwarejp/notificationhubs-rest-php/)

This is a implementation of a REST wrapper using the [REST APIs of Notification Hubs](http://msdn.microsoft.com/en-us/library/dn495827.aspx) from a PHP back-end.

## How to use the code above
Initialize your Notification Hubs client (substitute the connection string and hub name as instructed in the [Get started tutorial](http://azure.microsoft.com/en-us/documentation/articles/notification-hubs-ios-get-started/)):

$hub = new NotificationHub("connection string", "hubname");

Then add the send code depending on your target mobile platform.

### iOS

$factory = new NotificationFactory();
$notification = $factory->createNotification("apple", "Hello from PHP!");
$hub->sendNotification($notification);

### Android

$factory = new NotificationFactory();
$notification = $factory->createNotification("gcm", "Hello from PHP!");
$hub->sendNotification($notification);

## Notes
This code is provided as-is with no guarantees.