2017 © Pedro Peláez
 

symfony-bundle parse-bundle

Integration for Parse.com PHP SDK in your Symfony2 Project

image

gpaton/parse-bundle

Integration for Parse.com PHP SDK in your Symfony2 Project

  • Monday, February 19, 2018
  • by gpaton
  • Repository
  • 1 Watchers
  • 0 Stars
  • 212 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Parse Bundle

Introduction

This bundle provides integration for Parse.com PHP SDK in your Symfony2 Project., (*1)

As I currently don't use other Parse.com tools, I've only implemented Push notifications. You're free to contribute to add other tools., (*2)

Changelog

1.1.0, (*3)

1.0.0, (*4)

  • Allow to send push to channel or a ParseQuery

Installation

Install GpatonParseBundle

Simply run assuming you have installed composer.phar or composer binary:, (*5)

$ php composer.phar require gpaton/parse-bundle 1.1.*

Enable the bundle

Finally, enable the bundle in the kernel:, (*6)

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Gpaton\ParseBundle\GpatonParseBundle(),

    );
}

Push Notifications

Setting up

First, you need to configure the bundle with the keys obtained when you've created your application on Parse.com :, (*7)

# app/config/config.yml

gpaton_parse:
    app_id: APPLICATION_ID
    rest_key: REST_KEY
    master_key: MASTER_KEY

Usage

Then, you may send push notifications from your controller by loading the service gpaton.parse.push and use the send method :, (*8)

<?php
// Acme\DemoBundle\Controller\PushController

namespace Acme\DemoBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class PushController extends Controller {

    public function indexAction() {

        $push = $this->get('gpaton.parse.push');

        $data = ['alert' => 'Hi there !'];
        $channels = ['My Channel'];

        $push->send($data, $channels);

        // ...
    }
}

The send method takes up to 4 arguments. First is mandatory and you must supply at least second or third argument :, (*9)

  1. data array, (*10)

  2. Channels array (optional), (*11)

  3. ParseQuery (optional), (*12)

  4. pushTime \DateTime (optional), (*13)

If you want to send your push to channel(s), just follow the previous sample. To push to Query, you will use the createQuery method :, (*14)

<?php
// Acme\DemoBundle\Controller\PushController

namespace Acme\DemoBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class PushController extends Controller {

    public function indexAction() {

        $push = $this->get('gpaton.parse.push');

        $data = ['alert' => 'Hi there !'];
        $query = $push->createQuery();
        $query->equalTo('foo', 'bar');

        $push->send($data, null, $query);

        // ...
    }
}

If you want to schedule your Push in advance (2 weeks maximum due to Parse.com limitation) :, (*15)

<?php
// Acme\DemoBundle\Controller\PushController

namespace Acme\DemoBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class PushController extends Controller {

    public function indexAction() {

        $push = $this->get('gpaton.parse.push');

        $data = ['alert' => 'Hi there !'];
        $query = $push->createQuery();
        $query->equalTo('foo', 'bar');
        $scheduledTime = new \DateTime();
        $scheduledTime->modify('+5 days');

        $push->send($data, null, $query, $scheduledTime);

        // ...
    }
}

License

This bundle is under GPL v2 license. See the complete license in the bundle:, (*16)

Resources/meta/LICENSE

The Versions

19/02 2018

dev-master

9999999-dev http://gpaton.github.com

Integration for Parse.com PHP SDK in your Symfony2 Project

  Sources   Download

GPL v2 GPL-2.0-only

The Requires

 

bundle symfony sdk parse parse.com

19/02 2018

1.1.1

1.1.1.0 http://gpaton.github.com

Integration for Parse.com PHP SDK in your Symfony2 Project

  Sources   Download

GPL-2.0-only

The Requires

 

bundle symfony sdk parse parse.com

10/02 2016

1.1.0

1.1.0.0 http://gpaton.github.com

Integration for Parse.com PHP SDK in your Symfony2 Project

  Sources   Download

GPL v2

The Requires

 

bundle symfony sdk parse parse.com

01/12 2015

1.0.0

1.0.0.0 http://gpaton.github.com

Integration for Parse.com PHP SDK in your Symfony2 Project

  Sources   Download

GPL v2

The Requires

 

bundle symfony sdk parse parse.com