GithubHelp home page GithubHelp logo

siverchen / php-mysql---apple-push-notification-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bortuzar/php-mysql---apple-push-notification-server

2.0 2.0 1.0 100 KB

A set of classes to create and manage the Apple Push Notifications lifecycle.

Home Page: http://latitude33.co.uk

License: GNU Lesser General Public License v3.0

php-mysql---apple-push-notification-server's Introduction

Apple Push Notification Server.
------------------------------

These script allow you to manage push notifications for one or more apps.

FEATURES:

* Multiple App management.
* Multiple Certificate Management (Development/Production).
* Sample web form to submit push notifications.
* Monitor RSS feeds.
* Single connection per certificate to the APNS servers.
* Message queue.
* Apple Feedback processing to remove devices that should not subscribed any more. 
* Send push notifications only to test devices.

REQUIREMENTS:

* PHP 5.x
* mySQL 

PORTS:
It requires ports 2195 and 2196 to communicate with the APNS servers.


INSTALL:

* Create a new mySQL DB. 
* Run the "resources/APNS.sql" file to create the DB tables. 
* Customise the 'config.php' file.

SETUP YOUR APP:

* Copy your ck.pem certificates to the certificates folder. 'ck' means the certificate and key components are contained on the same file.
* Add an app entry to the mySQL 'Apps' table.
* Add a certificate to the mySQL 'Cerficates' table.
* Add an entry to the 'CertificateServer' table.


BASIC USAGE:

1) Registering new devices:
	
	Your iPhone apps can register new devices by calling a URL in this form:
	http://YOURDOMAIN.COM/registerDevice.php?appId=YOURAPPId&deviceToken=YOURDEVICETOKEN

2) Submit messages to the queue:

	To submit a message to the subscribed devices use the following:
	http://YOURDOMAIN.COM/subscriptionForm.php

3) Send messages to the devices from the message queue:

	http://YOURDOMAIN.COM/processMessageQueue.php

4) Process feedback:

	http://YOURDOMAIN.COM/processFeedback.php


ADVANCED USAGE:

At the moment don't provide documentation for setting up RSS feeds and creating multiple subscriptions with an app. But should be easy to setup by just looking at the project code.

* Feeds are registered via the registerDevice.php script by passing the 'feedUrl' and 'feedEnable' parameters.
* processFeeds.php should run as a cron job or schedule task.
* Multiple subscriptions within an app are registered by passing the 'appSubscriptionId' parameter.

SCHEDULING:

Ideally the processMesageQueue.php script should run from a cron job or scheduled task.
After running processMesageQueue.php you should run processFeedback.php to get 
notified of devices that no longer have the appId installed.


SECURITY:

Please store these scripts in a secure folder so they are not access
by non authorised users.

I hope you enjoy these scripts! Please fork :)

php-mysql---apple-push-notification-server's People

Contributors

bortuzar avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

xingskycn

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.