Download the PHP package markenzoo/contao-expo-push-notification-bundle without Composer

On this page you can find all versions of the php package markenzoo/contao-expo-push-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 contao-expo-push-notification-bundle

Contao Expo Push Notification Bundle

Version GitHub issues License Build Status Downloads

This extension provides a Contao CMS integration of push notifications for React Native using Expo.

Features

This extension for Contao 4.9 (and above) allows user to incooperate a Contao Backend into a mobile app made with react native and expo. Upon start of the mobile app a user will register against a backend service with a notification token. This token will then be used to trigger custom push notifications from the Contao Backend on the device. For further information see: here

Requirements

Install

Managed edition

When using the managed edition it's pretty simple to install the package. Just search for the package in the Contao Manager and install it. Alternatively you can use the CLI.

Symfony application

If you use Contao in a symfony application without contao/manager-bundle, you have to register the bundle manually:

Quickstart

In order to send a push notification to a mobile app, providers need to identify your device with Apple and Google through the Expo push token. This token is unique and generated each time the app is installed on a device. So all we need to do is send this token to our Contao installation so we can use it in the future for sending push notifications.

Send a token to your backend

This extensions for Contao provides a Controller which handles requests to store a token in the database used by your Contao installation. The table used for storing tokens is called tl_expo_push_notification_token. All you need to do is to send a POST-Request to the Endpoint https://your-server.com/api/notifications with the token from your mobile app. (Where "https://your-server.com" is the domain of your website and /api/notifications is the endpoint of the above mentioned controller.)

Take for example the following implementation and store it in a file called pushNotificationsAsync.js. Remember to replace "https://your-server.com" with the domain of your website.


Push Notifications are send via a plain old HTTP Request. In fact, you could simply write your one command line tool to send them if you want to. For this purpose, markenzoo/contao-expo-push-notification-bundle internally uses the solvecrew/expo-notifications-bundle. The benefit this extensions for Contao CMS provides, is that you can send them directly from your Contao Backend and enrich them with data from your Contao installation. Expo will do all the heavy lifting and execute the push notification on the different providers, namely Apple Push Notification service (APNs) for iOS and Firebase Cloud Messaging for Android.

Send a push notification to Expo

Note: For Android, you'll also need generate a Firebase Cloud Messaging server key and upload it to Expo so that Expo can send notifications to your app. This step is necessary unless you are not creating your own APK and using just the Expo client app from Google Play. To do so, follow the guide on Using FCM for Push Notifications to learn how to create a Firebase project, get your FCM server key, and upload the key to Expo.


You can send Push Notifications by navigating to Push Notifications in the Contao Backend.


You will no receive push notifications on your mobile app, which will appear in the system notification tray as you've come to expect, and tapping them will open/foreground the app. If your notifications are purely informational and you have no desire to handle them when they are received or selected, you're already done.

But Expo provides the capabilities to do much more! Maybe you want to update the UI based on the notification, or maybe navigate to a particular screen if a notification was selected. All you need to do is add a listener using the Notifications API. You can take e.g. the following implementation.

That's it ! 🎉

Further Reading

Note to self

Run the PHP-CS-Fixer and the unit test before you release your bundle:


All versions of contao-expo-push-notification-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
contao/core-bundle Version ^4.9
symfony/framework-bundle Version ^4.4 || ^5.2
solvecrew/expo-notifications-bundle Version ^1.2.1
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 markenzoo/contao-expo-push-notification-bundle contains the following files

Loading the files please wait ....