Giter Club home page Giter Club logo

laravel-push-notifications-ios-android's Introduction

Laravel Push Notifications

An Apple and Android Push Notification Service bundle for Laravel

##Instalation

###Artisan

php artisan bundle:install laravel-push-notifications-ios-android

###Manualy

https://github.com/filipposarzana/laravel-push-notifications-ios-android/

##Bundle Registration

Add the following code to your application/bundle.php file:

'push' => array(
  	'auto' 		=> true,
		'handles'	=> 'push'
	)

##Certificate for iOS

Paste your certificate into push/certificates/ and change configurations if you've changed file name

##Configuration

Edit the config/push.php file with your settings:

return array(
      'local' => array(
    		'ios' => array(
    			'host'  	=> 'gateway.sandbox.push.apple.com:2195',
		        'cert'  	=> path('bundle').'push/certificates/ck.pem',
		        'pwd'		=> '***'
    		),
    		'android' => array(
    			'id_project'	=> '***',
        		'api_key'		=> '***',
        		'host'			=> 'https://android.googleapis.com/gcm/send'
    		),
    	),
    	'prod' => array(
    		'ios' => array(
    			'host'  	=> 'gateway.push.apple.com:2195',
		        'cert'  	=> path('bundle').'push/certificates/ck.pem',
		        'pwd'		=> '***'
    		),
    		'android' => array(
    			'id_project'	=> '***',
        		'api_key'		=> '***',
        		'host'			=> 'https://android.googleapis.com/gcm/send'
    		),
    	),
    );

##Usage

Instance:

$push = Push::make();
//or
$push = new Push;

Custom configuration:

$push = Push::make(
	array(
		'host' => 'gateway.sandbox.push.apple.com:2195',
		'cert' => 'yourcertificate.pem'
	)
);

Parameters

YOUR TOKEN -> mandatory
MESSAGE -> string
BADGE -> integer (incremental badge has to be done serverside)
SOUND -> custom sound file
ACTION KEY -> Slide to 'ACTION KEY'
EXTRA PARAMETERS -> array(). Add any extra parameters as array to be sent to the application and do extra functions such as open a defined view.

Certificate for iOS Paste your certificate into push/certificates/ and change configurations if you've changed file name

Send a message: iOS

$push->ios('YOUR TOKEN', 'MESSAGE', 'BADGE', 'SOUND', 'ACTION KEY', 'EXTRA PARAMETERS');

Android

$push->android('YOUR TOKEN', 'MESSAGE', 'BADGE', 'SOUND', 'ACTION KEY', 'EXTRA PARAMETERS');

Questions @fsarzana

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.