Download the PHP package bnbwebexpertise/laravel-push-notifications without Composer

On this page you can find all versions of the php package bnbwebexpertise/laravel-push-notifications. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-push-notifications

[DEPRECATED] Apple and Google Push Notifications for Laravel 5

Use Firebase Cloud Messaging

Installation

For Laravel 5.4 or older, add the provider in your config/app.php :

Laravel 5.5 use Composer auto-discovery feature.

Configuration

Configuration via environment

To return the APNs payloads in the results array (debugging purpose) :

PUSH_RETURN_PAYLOADS=true

Apple Push Notification Service

Put your APNs certificate somewhere inside your project path. Add the relative path to your certificate in your .env file :

PUSH_APNS_CERTIFICATE=config/push/certificate.pem

If your certificate is secured with a password you can specify it in the .env file as :

PUSH_APNS_PASSWORD=changeme

You can also set the environnement to use (default to production) :

PUSH_APNS_ENVIRONMENT=development

Google Cloud Messaging

Grap you API key from the Google Developer Console and add it to your .env file :

PUSH_GCM_KEY=AIaeRtYiUoP-QsDfghQJK1lMWXCvBN23AZE4RT6u

Configuration via PHP

If you prefer to configure the module from a config PHP file, publish it :

php artisan vendor:publish --provider=Bnb\\PushNotifications\\PushNotificationsServiceProvider --tag=config

Then set the desired configuration values :

Configuration at runtime

The GCM and APNs configuration can be changed at runtime via the setGcmOption($key, $value) and setApnsOption($key, $value) methods of the Notification class.

GCM options

Key Default Description
key config('push.gcm.key') The GCM server API key

APNs options

Key Default Description
certificate base_path(config('push.apns.certificate')) The APNs certificate path on the server filesystem
password config('push.apns.password') The APNs certificate password
environment config('push.apns.environment') The APNs environnement

Usage

A notification message holds the following properties where each one can be overridden by the device definition :

Name Type Description
title string The title displayed in the notification bar
message message The message displayed in the notification bar (platform dependent)
badge int The badge number displayed in the notification bar
sound string The sound to play when the notification is received (platform dependent)
ttl int Number of seconds after which the message is expired by the network
metadata array Key/Value pairs of custom data

Metadata

For APNs the props custom property holds the list of the metadata keys including title and message.

For GCM the metadata are bound to the appdata object.

Example

Commands

You can use the following Artisan command lines to send test messages :

Send to Android devices

php artisan push:gcm [options] [--] <token> <message> [<title>]

Example :

Send to iOS devices

php artisan push:apns [options] [--] <token> <message> [<title>]

Example :


All versions of laravel-push-notifications with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
duccio/apns-php Version ^1.0
illuminate/support Version 5.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bnbwebexpertise/laravel-push-notifications contains the following files

Loading the files please wait ....