Download the PHP package potagercity/expo-notifications-bundle without Composer

On this page you can find all versions of the php package potagercity/expo-notifications-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 expo-notifications-bundle

README

This Bundles purpose is to handle the BE tasks of the push notifications service for the expo react-native Framework.

Installation

Install the bundle using composer:

Enable the Bundle in the app/AppKernel.php file:

Configuration

At the moment, this bundle only has a single optional configuration parameter.

If you want (optional), add this to your app/config/config.yml file:

And then add the expo_api_endpoint parameter in your app/config/parameters.yml file:

If you prefer to not add it as a parameter in your parameters.yml file you can add the URI in your config.yml file directly:

IMPORTANT: All this is completely OPTIONAL. If you don't add the config at all, it will use https://exp.host/--/api/v2/push/send as fallback since it is the endpoint from the official Expo Documentation.

Usage

This bundle provides you with an easy way to send push notifications for a front-end application using the Expo React-Native framework. Therefore the bundle provides you with several helpful things:

The service of the NotificationManager is sc_expo_notifications.notification_manager.

NOTE that the important part here is the arguments: ['@sc_expo_notifications.notification_manager'] of course.

After you have the NotificationManager available you can access its functions. Popular functions are:

  1. sendNotifications(...): Send multiple notifications in one API request.

Therefore you need to provide an array of messages as strings and an array of tokens as strings (to be more specific: The recipients ExponentPushToken. Like sITGtlHf1-mSgUyQIVbVMJ, without the ExponentPushToken[] sourrounding.). The first message in the messages array will be delivered to the first token (recipient) in the tokens array. And so on. Optionally you can provide a titles array which holds titles for the notifications. Last, you can provide an array of data arrays that will be added to the notification as a JSON object for further handling in the front-end. It is important to know, that each notification needs an array as data! See the Full Example below for more information.

The function returns you an array of NotificationContentModel. One for each notification that was tried to send. Those NotificationContentModels hold all the information about the notification.

For example:

  1. sendNotification(...): Send a single notification providing only a message string and a token. Optionally a title.

As you can see, this one is really straight forward. It returns a single NotificationContentModel as descibed above. The title (string) and the data (array) are optional. If provided, $data must be an array.

Full Example

To even ease the integration process further, see the following example.

If your use case is more complex or you just want to leverage more of the notification funtions you can use the sendNotificationHttp function of the NotificationManager. For that you need to create the NotificationContentModel yourself.

If you want to send multiple notifications this way, use sendNotificationsHttp (plural).

Troubleshooting

If the service sc_expo_notifications.notification_manager is not available for some reason, debug your container with bin/console debug:container | grep notification. You should see:

The first service is the guzzle client which is the dependency of our bundle. The second service is the notificationManager the bundle provides to handle all notification related tasks.

Based on the Expo push notifications API

To see the process and the API documentation for the Expo push notifications service see: https://docs.expo.io/versions/v14.0.0/guides/push-notifications.html

LICENSE

Created by SolveCrew 2017. Contact us if you like: [email protected] or visit our website: www.solvecrew.com MIT


All versions of expo-notifications-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
eightpoints/guzzle-bundle Version ^6.0|~7.0
guzzlehttp/guzzle Version ~6.0
eightpoints/guzzle-wsse-middleware Version ~4.0
symfony/dependency-injection Version ~2.3|~3.0|~4.0
symfony/expression-language Version ~2.3|~3.0|~4.0
symfony/event-dispatcher Version ~2.3|~3.0|~4.0
symfony/http-kernel Version ~2.3|~3.0|~4.0
psr/log Version ~1.0
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 potagercity/expo-notifications-bundle contains the following files

Loading the files please wait ....