openium/platinium-bundle

Provides push notification on Platinium for your Symfony4 Project

v1.1.6 2019-10-15 13:38 UTC

This package is not auto-updated.

Last update: 2024-05-22 11:25:11 UTC


README

This bundle provide a easy way to send a push message by using Platinium

Caution

Versions < 1.1.6 are deprecated

Installation

Open a command console, enter your project directory and execute:

$ composer require openium/platinium-bundle

Configuration

You need to add 4 information in the .env

###> openium/platinium-bundle ###
PLATINIUM_SERVER_ID=
PLATINIUM_SERVER_KEY=
PLATINIUM_SERVER_TOKEN_DEV=
PLATINIUM_SERVER_TOKEN_PROD=
###< openium/platinium-bundle ###

Usage

Example :

// set by dependency injection
$notifier = new PlatiniumNotifier(...);
// get number of future pushed devices
$deviceCount = $notifier->subscribe($groups, $langs, $langNotIn, $latitude, $longitude, $tolerance, $radius, $paramsBag, $badgeValue, $newsStand, $sound);
// send a push message
$pushSended = $notifier->notify($message, $groups, $langs, $langNotIn, $latitude, $longitude, $tolerance, $radius);