Skip to content
This repository has been archived by the owner on Jun 6, 2021. It is now read-only.


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


A bundle to allow sending of push notifications to mobile devices. Currently supports Android (C2DM, GCM), Blackberry and iOS devices.


To use this bundle in your Symfony2 project add the following to your composer.json:

    "require": {
        // ...
        "richsage/rms-push-notifications-bundle": "dev-master"

and enable it in your kernel:

// app/AppKernel.php

public function registerBundles()
    $bundles = array(
        // ...
        new RMS\PushNotificationsBundle\RMSPushNotificationsBundle(),

NOTE: If you are still using Symfony 2.0, please use the symfony2.0 branch.


Configuration options available are as follows. Note that the specific services will only be available if you provide configuration respectively for them.

      timeout: 5 # Seconds to wait for connection timeout, default is 5
          username: <string_android_c2dm_username>
          password: <string_android_c2dm_password>
          source: <string_android_c2dm_source>
          api_key: <string_android_gcm_api_key> # This is titled "Server Key" when creating it
          use_multi_curl: <boolean_android_gcm_use_multi_curl> # default is true
          dry_run: <bool_use_gcm_dry_run>
      timeout: 60 # Seconds to wait for connection timeout, default is 60
      sandbox: <bool_use_apns_sandbox>
      pem: <path_apns_certificate> # can be absolute or relative path (from app directory)
      passphrase: <string_apns_certificate_passphrase>
      timeout: 60 # Seconds to wait for connection timeout, default is 60
      sandbox: <bool_use_apns_sandbox>
      pem: <path_apns_certificate>
      passphrase: <string_apns_certificate_passphrase>
      timeout: 5 # Seconds to wait for connection timeout, default is 5
      evaluation: <bool_bb_evaluation_mode>
      app_id: <string_bb_app_id>
      password: <string_bb_password>
      timeout: 5 # Seconds to wait for connection timeout, default is 5

NOTE: If you are using Windows, you may need to set the Android GCM use_multi_curl flag to false for GCM messages to be sent correctly.

Timeout defaults are the defaults from prior to the introduction of this configuration value.


A little example of how to push your first message to an iOS device, we'll assume that you've set up the configuration correctly:

use RMS\PushNotificationsBundle\Message\iOSMessage;

class PushDemoController extends Controller
    public function pushAction()
        $message = new iOSMessage();
        $message->setMessage('Oh my! A push notification!');


        return new Response('Push notification send!');

The send method will detect the type of message so if you'll pass it an AndroidMessage it will automatically send it through the C2DM/GCM servers, and likewise for Mac and Blackberry.

Android messages

Since both C2DM and GCM are still available, the AndroidMessage class has a small flag on it to toggle which service to send it to. Use as follows:

use RMS\PushNotificationsBundle\Message\AndroidMessage;

$message = new AndroidMessage();

to send as a GCM message rather than C2DM.

iOS Feedback service

The Apple Push Notification service also exposes a Feedback service where you can get information about failed push notifications - see here for further details.

This service is available within the bundle. The following code demonstrates how you can retrieve data from the service:

$feedbackService = $container->get("");
$uuids = $feedbackService->getDeviceUUIDs();

Here, $uuids contains an array of Feedback objects, with timestamp, token length and the device UUID all populated.

Apple recommend you poll this service daily.

Windows Phone - Toast support

The bundle has beta support for Windows Phone, and supports the Toast notification. Use the WindowsphoneMessage message class to send accordingly.


Firstly, thanks to all contributors to this bundle!

Secondly, thanks to JetBrains for their sponsorship of an open-source PhpStorm licence for this project.


NOT MAINTAINED! ⛔️ Push notifications/messages for mobile devices. Supports iOS, Android (C2DM, GCM), Blackberry and Windows Mobile (toast only). A Symfony2 bundle.







No packages published