Download the PHP package reliefapps/notification-bundle without Composer

On this page you can find all versions of the php package reliefapps/notification-bundle. 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 notification-bundle

Latest Stable Version Total Downloads SensioLabsInsight

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

NB: Before version 1, backward compatibility may be broken. It is advised to force a single version of the bundle has shown here

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

Step 3 : Configure the Bundle

In your project, add at the end of the file app/config/config.yml the following configuration :

Optional (but recommended) :

For improved error management for iOS notifications, you will need http2 support for cURL on your machine. See this tutorial.

Once you have followed this tutorial, check that cURL supports HTTP/2 by running :

If it works, you can remove the line :

in your app/config/config.yml file.

Usage

Step 1: Create a Device Entity

First you will need to create you own Device Entity extending this Bundle's ReliefappsNotificationBundle:Device entity.

Then complete your app/config/config.yml file with :

Step 2: Register some devices

In a strategic api controller (login, homepage), register the device UUID and token :

Step 3: Create a notification Body

The class NotificationBody allows you to create the content of a push notification.

Step 4: Send a push notification

You are ready to send your first Push Notification !

The function sendPush takes an array of devices and a notification body, and sends the Push notifications to the devices !

If a token is invalid, it will be set to null on your database automatically.

Advanced Configuration

Contexts

The configuration presented above does not allow you to switch servers (to switch between dev and prod) or to change apns_topic and certificates (to manage multiple applications from a single backend).

To solve this issue, we introduced the Object Context. A context is a set of configurations that can be used independently.

Contexts are defined in your :

All fields that are not filled in the context will be filled with the default configuration.

You can call the context by its name with the PushManager.

For more info, lookup Reliefapps\NotificationBundle\Resources\Utils\ContextManager and Reliefapps\NotificationBundle\Resources\Model\Context.

Additional fields

You may want to add some data to the notification wanted to be sent.

Documentation

Payloads

Entity : Reliefapps\NotificationBundle\Resources\Model\NotificationBody

Key Description iOS Android
title Title [x] [x]
body Main text [x] [x]
ledColor Led color on front of the phone [ ] [x]
image Path to the icon to use in the app [ ] [x]
imageType Shape of the notification icon [ ] [x]
notId Id of the notification to distinguish them [ ] [x]
actions List of action [ ] [x]
badge Badge number on app icon [x] [ ]
category iOS category tag (defined in your app) [x] [ ]

Android Action

Entity : Reliefapps\NotificationBundle\Resources\Model\AndroidAction

Key Description iOS Android
icon Icon (name of an app drawable ressource) [ ] [x]
title Action text [ ] [x]
callback Function to call as the button is clicked [ ] [x]
foreground Open the app after click ? (default true) [ ] [x]
inline Use quick reply field ? (default false) [ ] [x]

SensioLabsInsight


All versions of notification-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
symfony/symfony Version ^3.2.0
symfony/monolog-bundle Version ^3.0.2
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 reliefapps/notification-bundle contains the following files

Loading the files please wait ....