Giter Club home page Giter Club logo

laravel-push-notification's Introduction

Laravel Push Notification

Package to enable sending push notifications to devices

Installation

Update your composer.json file to include this package as a dependency

Laravel 5 & Lumen

"davibennun/laravel-push-notification": "dev-laravel5"

Laravel 4.*

"davibennun/laravel-push-notification": "dev-master"

Register the PushNotification service provider by adding it to the providers array.

'providers' => array(
	...
	'Davibennun\LaravelPushNotification\LaravelPushNotificationServiceProvider'
)

Alias the PushNotification facade by adding it to the aliases array in the app/config/app.php file.

'aliases' => array(
	...
	'PushNotification' => 'Davibennun\LaravelPushNotification\Facades\PushNotification'
)

Configuration

Copy the config file into your project by running: (Lumen users skip this)

Laravel 5

php artisan vendor:publish --provider="Davibennun\LaravelPushNotification\LaravelPushNotificationServiceProvider" --tag="config"

Laravel 4.*

php artisan config:publish davibennun/laravel-push-notification

This will generate a config file like this

array(
    'appNameIOS'=>array(
		'environment' => 'development',
		'certificate' => '/path/to/certificate.pem',
		'passPhrase'  => 'password',
		'service'     => 'apns'
    ),
    'appNameAndroid'=>array(
		'environment' => 'production',
		'apiKey'      => 'yourAPIKey',
		'service'     => 'gcm'
    )
);

Where all first level keys corresponds to an service configuration, each service has its own properties, android for instance have apiKey and IOS uses certificate and passPhrase. You can set as many services configurations as you want, one for each app.

Dont forget to set service key to identify IOS 'service'=>'apns' and Android 'service'=>'gcm'
The certificate path must be an absolute path, so in the configuration file you can use these:
//Path to the 'app' folder
'certificate'=>app_path().'/myCert.pem'

Laravel functions are also available public_path() storage_path() base_path()

Usage

PushNotification::app('appNameIOS')
                ->to($deviceToken)
                ->send('Hello World, i`m a push message');

Where app argument appNameIOS refers to defined service in config file.

Dynamic configuration and Lumen users

You can set the app config array directly: (keep in mind the array schema)

//iOS app
PushNotification::app(['environment' => 'development',
		'certificate' => '/path/to/certificate.pem',
		'passPhrase'  => 'password',
		'service'     => 'apns']);
//Android app		
PushNotification::app(['environment' => 'production',
		'apiKey'      => 'yourAPIKey',
		'service'     => 'gcm']);

To multiple devices and optioned message:

$devices = PushNotification::DeviceCollection(array(
    PushNotification::Device('token', array('badge' => 5)),
    PushNotification::Device('token1', array('badge' => 1)),
    PushNotification::Device('token2')
));
$message = PushNotification::Message('Message Text',array(
    'badge' => 1,
    'sound' => 'example.aiff',
    
    'actionLocKey' => 'Action button title!',
    'locKey' => 'localized key',
    'locArgs' => array(
        'localized args',
        'localized args',
    ),
    'launchImage' => 'image.jpg',
    
    'custom' => array('custom data' => array(
        'we' => 'want', 'send to app'
    ))
));

$collection = PushNotification::app('appNameIOS')
    ->to($devices)
    ->send($message);

// get response for each device push
foreach ($collection->pushManager as $push) {
    $response = $push->getAdapter()->getResponse();
}

// access to adapter for advanced settings
$push = PushNotification::app('appNameAndroid');
$push->adapter->setAdapterParameters(['sslverifypeer' => false]);

This package is wrapps Notification Package and adds some flavor to it.

Usage advice

This package should be used with Laravel Queues, so pushes dont blocks the user and are processed in the background, meaning a better flow.

laravel-push-notification's People

Contributors

bryant1410 avatar davibennun avatar javiermartinz avatar lookitsatravis avatar pabloleone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-push-notification's Issues

customize alert for loc-key

Hello.

I try to send ios push with loc-key parameters.
Davibennun can't send alert = array(loc-key=>'sometext');
I get exception as "cannot conver array to string".
LPL packet can't get hash for array too..

But it necessary for push localisation as lock-key parameter in alert.
please extend functional for alert ios value or as array type or as json text.

Thank you VMch!
And thank you for your good laravel plugin. :)

getting response from push(es) doesn't work anymore

This doesn't work anymore

foreach ($regIds as $regId) {
    $devices[] = Push::Device($regId);
}

// set adapter & send
$push = Push::app('gcmMain');
$push->adapter->setAdapterParameters(['sslverifypeer' => false]);

$collection = $push
    ->to(Push::DeviceCollection($devices))
    ->send(Push::Message($data['message'], $data));

foreach ($collection as $push) {
    $response = $push->getAdapter()->getResponse();
}

Set certificate dynamically

Is it currently possible to set the certificate programmatically? We have a need to use multiple certificates which will be selected at runtime and not in the config file.

If not, I'll fork and implement.

Thanks

Device token must be mask "/[^0-9a-f]/". Token given: "TOKEN........"

config :
'appNameIOS'=>array( 'environment' => 'development', 'certificate' => base_path(). '\pushProd.pem', 'passPhrase' => '', 'service' => 'apns' )
and PushNotification::app('appNameIOS')->to("FA87F3994E03640A370F4EC5E5F2337B5CCBF4A155595FADDBE81DCD0DF47A03") ->send('Hello World, im a push message'); it got error, sorry i don't know english

Error when composer run update

Hi guys,
Ii ran composer update to get library
"require": {
"laravel/framework": "4.2.*",
"davibennun/laravel-push-notification": "dev-master"

.......

This is error:

Problem 1
- Installation request for davibennun/laravel-push-notification dev-master -

satisfiable by davibennun/laravel-push-notification[dev-master].
- davibennun/laravel-push-notification dev-master requires sly/notification-
pusher 2.* -> no matching package found.

Potential causes:

Read http://getcomposer.org/doc/articles/troubleshooting.md for further common
problems.

Please say me why? and how to fix?\

Thanks so much!

Push notification with Laravel with loc-key in IOS

I am trying to push notification with loc-key and loc-args with these lines of code.

    $message = \PushNotification::Message("sentMsg",$detailForPush);

    \PushNotification::app('myApp')->to($userDevice->deviceToken)->send($message);

and the $detailForPush are as follow:

    detail for push : {"badge":1,"custom":{"custom data":{"itemId":"10","gid":"1"}},
    "alert":{"lockey":"PUSH_MSG_FROM_GROUP","loc-args":["General","sentMsg"]}}

in my IOS Application, I set the "PUSH_MSG_FROM_GROUP" = "%@ : %@";
in my app's Localizable.strings

but when my IOS device receive push notification, i got this
push notification : {
aps = {
alert = sentMsg;
badge = 1;
sound = "bingbong.aiff";
};
"custom data" = {
gid = 1;
itemId = 10;
};

my alert key is overrided by the text. Any idea??

Unable to connect to android.googleapis.com:443

Everything is working fine on my localhost but when uploaded to my server I'm getting -

Unable to connect to android.googleapis.com:443 . Error #0: stream_socket_client(): unable to connect to android.googleapis.com:443 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. )

Maximum execution time of 30 seconds exceeded

Hello,

My error is "Maximum execution time of 30 seconds exceeded" after push notification to iOS.

protected function read($length = 1024)
{
if (!$this->isConnected()) {
throw new Exception\RuntimeException('You must open the connection prior to reading data');
}
$data = false;
if (!feof($this->socket)) {
$data = fread($this->socket, (int) $length);//this line
}

I use Laravel4..

Special Characters

I'm trying to sent push notification with special characters like "Á ó" or something like that and i dont receive the notification any idea? i trying to use ut8 encode and nothing..

Any ideas?
Thx

Requirement specification

I had some trouble installing the package, please specify within your readme that your package requires
"sly/notification-pusher": "dev-master"

to work probably otherwise good job done.

Improvement || // Parse error: syntax error, unexpected T_OBJECT_OPERATOR in ...

Due to a bug in PHP < 5.4 Cannot chain lookups/calls

http://phpsadness.com/sad/21

You should update the PushNotification.php to this one to avoid this issue:

<?php namespace Davibennun\LaravelPushNotification;

class PushNotification {

    public function app($appName)
    {
        return new App(\Config::get('laravel-push-notification::'.$appName));
    }

    public function Message()
    {
      $instance = (new \ReflectionClass('Sly\NotificationPusher\Model\Message'));
        return $instance->newInstanceArgs(func_get_args());
    }

    public function Device()
    {
      $instance = (new \ReflectionClass('Sly\NotificationPusher\Model\Device'));
        return $instance->newInstanceArgs(func_get_args());
    }

    public function DeviceCollection()
    {
      $instance = (new \ReflectionClass('Sly\NotificationPusher\Collection\DeviceCollection'));
        return $instance->newInstanceArgs(func_get_args());
    }

    public function PushManager()
    {
      $instance = (new \ReflectionClass('Sly\NotificationPusher\PushManager'));
        return $instance->newInstanceArgs(func_get_args());
    }

    public function ApnsAdapter()
    {
      $instance = (new \ReflectionClass('Sly\NotificationPusher\Adapter\ApnsAdapter'));
        return $instance->newInstanceArgs(func_get_args());
    }

    public function GcmAdapter()
    {
      $instance = (new \ReflectionClass('Sly\NotificationPusher\Model\GcmAdapter'));
        return $instance->newInstanceArgs(func_get_args());
    }

    public function Push()
    {
      $instance = (new \ReflectionClass('Sly\NotificationPusher\Model\Push'));
        return $instance->newInstanceArgs(func_get_args());
    }

}

Laravel 5 Support

I am trying to install with Laravel 5 but i am facing installation error

Maximum execution time of 30 seconds exceeded

Hi folks!

I decide to use this package for my push notification sender.

So, I use it. The message arrives in iPhone, but I have this error

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)
HELP
Maximum execution time of 30 seconds exceeded

    protected function read($length = 1024)
    {
        if (!$this->isConnected()) {
            throw new Exception\RuntimeException('You must open the connection prior to reading data');
        }
        $data = false;
        if (!feof($this->socket)) {
            $data = fread($this->socket, (int) $length); //<--- error
        }

The strange is that it works perfectly, but I had this error.

My code

    $message = PushNotification::Message('Message!!!',array(
        'badge' => 1,
        'sound' => 'default',
    ));

    $push = PushNotification::app('ios');

    $push->to('09008c27079f7acf592aa7a31345b93b47089ac84721aff4478eXXXXXe19')->send($message);

My conf

return array(

    'ios'     => array(
        'environment' =>'development',
        'certificate' =>app_path().'/assets/apple_push_notification_production.pem',
        'passPhrase'  =>'XXXXX',
        'service'     =>'apns'
    ),
    'android' => array(
        'environment' =>'production',
        'apiKey'      =>'yourAPIKey',
        'service'     =>'gcm'
    )

);

Any idea?

how to set optional parameters in Android GCM

I am trying to set keys like "collapseKey" and "delayWhileIdle" in GCM . I have no idea how to set those keys . This is how I set keys .

$message = PushNotification::Message($msg,array(
            'msgcnt'=> 1,
            'title'=>$event->title,
            'collapseKey' => 'invited' 
));

According to this collaposeKey is not working . And it is also inside payload of GCM instead .
any idea ? thanks

apns DeviceCollection work?

  1. setting 100 device.
    $devices = PushNotification::DeviceCollection(array(
    PushNotification::Device('token', array('badge' => 5)),
    PushNotification::Device('token1', array('badge' => 1)),
    ....
    ));
  2. send.
    $collection = PushNotification::app('appNameIOS')
    ->to($devices)
    ->send($message);

APNS first device work when multiple device per call.
others not working.

each device call work find.

Laravel 5 error

I'm getting this error:

{
    "exception": {
        "type": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
        "code": 1,
        "message": "Class 'Sly\\NotificationPusher\\Adapter\\' not found",
        "file": "/var/www/reverse-api/vendor/davibennun/laravel-push-notification/src/Davibennun/LaravelPushNotification/App.php",
        "line": 19,
        "stackTrace": []
    }
}

My composer.json:

{
    "name": "plugapps/appname",
    "description": "Description here",
    "keywords": ["asdf", "asdf"],
    "license": "MIT",
    "type": "project",
    "require": {
        "laravel/framework": "5.0.*",
        "predis/predis": "~1.0",
                "aws/aws-sdk-php-laravel": "~2.0",
        "barryvdh/laravel-ide-helper": "~2.0",
                "barryvdh/laravel-cors": "0.5.x@dev",
                "tymon/jwt-auth": "dev-laravel-5",
                "davibennun/laravel-push-notification": "dev-laravel5"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "Reverse\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
                        "php artisan ide-helper:generate",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan ide-helper:generate",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php -r \"copy('.env.example', '.env');\"",
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

Whats happen?

Laravel 5 Compatibility

Hello,

Me and my company are getting ready to integrate Push Notifications into our application. However, we are developing on Laravel 5. Is there an ETA on getting this updated to be compatible with L5?

Cheers,
Andrew

How to trouble shoot the push notification??

I have set the cert in app/config/packages/davibennun/laravel-push-notifcation/config.php

and made a testing function like this and hardcoded the devicetoken to it.
\PushNotification::app('CP2')->to("mydevicetoken")->send('Hello World, i`m a push message');

the function run without error, but my iphone didnt' get the notification.
how can I troubleshoot this issue??

Question: Does this work for Laravel 4.1.x?

I get an issue when trying to install for Laravel 4.1.x:

Problem 1
- zendframework/zend-json dev-develop requires zendframework/zend-stdlib dev-develop -> no matching package found.
- sly/notification-pusher v2.2.4 requires zendframework/zendservice-google-gcm 1.* -> satisfiable by zendframework/zendservice-google-gcm[1.0.1].
- zendframework/zendservice-google-gcm 1.0.1 requires zendframework/zend-json >=2.0.0 -> satisfiable by zendframework/zend-json[2.3.x-dev].
- davibennun/laravel-push-notification dev-master requires sly/notification-pusher 2.* -> satisfiable by sly/notification-pusher[v2.2.4].
- remove zendframework/zend-json 2.3.x-dev|keep zendframework/zend-json dev-develop

  • Installation request for davibennun/laravel-push-notification dev-master -> satisfiable by davibennun/laravel-push-notification[dev-master].

Verify return code: 20

is there any way to solve error " Verify return code: 20 (unable to get local issuer certificate) " by passing an additional parameter?

depth=1 C = US, O = "Entrust, Inc.", OU = www.entrust.net/rpa is incorporated by reference, OU = "(c) 2009 Entrust, Inc.", CN = Entrust Certification Authority - L1C
verify error:num=20:unable to get local issuer certificate
verify return:0

OS: Ubuntu 14.04 / LEMP

Here is how I test connection:
openssl s_client -connect gateway.push.apple.com:2195 -cert push.pem -key push.pem

I also ran these in /etc/ssl/certs/ directory
wget https://www.entrust.net/downloads/binary/entrust_2048_ca.cer -O - > entrust_root_certification_authority.pem
echo >> entrust_root_certification_authority.pem
wget https://www.entrust.net/downloads/binary/entrust_ssl_ca.cer -O - >> entrust_root_certification_authority.pem

related thread:
zendframework/zendframework#5870

sslcafile and ssclapath issue

Hello!

I am receiving this error only in Android (iOS is working well).

'Zend\Http\Client\Adapter\Exception\RuntimeException' with message 'Unable to enable crypto on TCP connection android.googleapis.com: make sure the "sslcafile" or "sslcapath" option are properly set for the environment.' in /home/casper/development/vendor/zendframework/zend-http/Zend/Http/Client/Adapter/Socket.php:310

Do you know how to solve it? I've been googling a little bit but I haven't found a proper solution.

Thank you very much! :D

Minimum stability

Could you update the "minimum-stability" to"stable" instead of "dev" ?

Tip: User device token

I need advice
How to store user device token?
ex.
When user on iphone login into app then I store his token?Keep that token hole time?
When user log out then remove or delete token?

What about when user decide to remove app? I will get response from apple so I can remove token?

Thanks

Your four hours ago changes is giving me error during composer installation

I just try pushing my code base to my hosting provider and I got an error. That your package requires php version 5.4.0 but when I change my php version, the push command hangs and indicates it cannot find php command, Pagoda Box is my hosting provider, my request is can you give me the version number for the previous one before these changes today.
I am using laravel 4.1

I only get the error 500 from my remote server

Hello, I'm using this library, everything in android goes fine in localhost and in my remote server. Also everything is fine in IOS but only in my localhost; in the remote server I only get the 500 error (after 30 seconds), I don't know what is going on. Can you help me please?

Adapter Gcm does not support ... token's device

I'm getting this error:

AdapterException in Push.php line 89:
Adapter Gcm does not support edPFWelGppM:APA91bHJVSV3IUmXP1Lsr... token's device

I use Laravel 5
Here my code that cause error:

        $registrationIds = 'myDeviceTokenId';

        $msg = 'Houston we had a problem ...';
        $fields = ['registration_ids'   => $registrationIds,
                   'data'               => $msg ];

        // access to adapter for advanced settings
        $push = PushNotification::app('appNameAndroid');
        $push->adapter->setAdapterParameters([
            'sslverifypeer' => false,
            'post'          => true,
            'returntransfer' => true,
            //'post_fields'   => json_encode($fields),
        ]);
        $push->to($registrationIds);
        $push->send($msg, []);

If I use this simple script to send an Android push notification, it work well.
https://gist.github.com/prime31/5675017

I've test on both local Ubuntu and server CentOS machine:

Linux version 3.10.0-123.20.1.el7.x86_64 ([email protected]) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Thu Jan 29 18:05:33 UTC 2015

Linux version 3.2.67-mykernel (root@nickfarrow-3500) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #3 SMP Fri Mar 27 19:53:37 ICT 2015

My push-notification.php setting:

    'appNameIOS'     => array(
        'environment' =>'development',
        'certificate' =>config_path().'/certificate/key.pem',
        'passPhrase'  =>'12345678',
        'service'     =>'apns'
    ),
    'appNameAndroid' => array(
        'environment' =>'production',
        'apiKey'      =>'AIzaSyA__***', // yourAPIKey
        'service'     =>'gcm'
    )

My composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "laravel/framework": "5.0.*",
        "jenssegers/agent": "^2.1",
        "fzaninotto/faker": "^1.5",
        "barryvdh/laravel-debugbar": "^2.0",
        "illuminate/html": "^5.0",
        "davibennun/laravel-push-notification": "dev-laravel5"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1",
        "xethron/migrations-generator": "dev-l5",
        "way/generators": "dev-feature/laravel-five-stable",
        "sboo/multiauth" : "4.0.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "files": [
             "app/helpers.php"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php -r \"copy('.env.example', '.env');\"",
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "repositories": [
        {
            "type": "git",
            "url": "[email protected]:jamisonvalenta/Laravel-4-Generators.git"
        }
    ]
}

I think this may be related to
Ph3nol/NotificationPusher#21

So I suggest to change vendor/sly/notification-pusher/src/Sly/NotificationPusher/Model/Push.php:
about line 89->

      if($adapter->getAdapterKey() != "gcm") {
            // fix me : this is core modifying
            foreach ($devices as $device) {
                if (false === $adapter->supports($device->getToken())) {
                    throw new AdapterException(
                        sprintf(
                            'Adapter %s does not support %s token\'s device',
                            (string) $adapter,
                            $device->getToken()
                        )   
                    );  
                }   
            }   
        } //

Thank you very much!

Lumen support

I think this package is a must have for those of us trying to cook Lumen APIs for mobile apps :)

Thank you for a great package!

MismatchSenderId error

When i dump the response it givee me MismatchSenderId error
What can be the issue ??

Also how can we access the properties of the response ?

here is my code for getting response

// get response for each device push
        foreach ($ret_collection->pushManager as $push) {
                $response = $push->getAdapter()->getResponse();
                var_dump($response);


        }

Call to undefined method Davibennun\LaravelPushNotification\App::getAdapter()

I just installed the package and did a simple implementation on my router as below:

Route::get('pusher', function(){
    $deviceToken = '1234567890';
    $push = PushNotification::app('appNameAndroid')
        ->to($deviceToken)
        ->send('Hello World, i`m a push message');

    $response = $push->getAdapter()->getResponse();
    // $response = $push->getAdapter()->getFeedback();
    return $response;
});

I got the error:

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)
Call to undefined method Davibennun\LaravelPushNotification\App::getAdapter()

highlighting the $response = ... line

I have also published my config file and added the android apiKey. What could I be missing?

gcm no sslverifypeer

I got this error Ph3nol/NotificationPusher#21 ,
and the fix consists of calling gcm's adapter method setAdapterParameters(['sslverifypeer' => false])

In my understanding, there is no way to access the adapter object in your lib right ?
So I suggest to change App constructor:

    public function __construct($config){
        $this->pushManager = new PushManager($config['environment'] == "development" ? PushManager::ENVIRONMENT_DEV : PushManager::ENVIRONMENT_PROD);

        $service = $config['service'];
        $adapterClassName = 'Sly\\NotificationPusher\\Adapter\\'.ucfirst($service);

        $adapterConfig = $config;
        unset($adapterConfig['environment']);
        unset($adapterConfig['service']);

        $this->adapter = new $adapterClassName($adapterConfig);

        if ($service === 'gcm') {
            $this->adapter->setAdapterParameters(array('sslverifypeer' => false));
        }

    }

Installation problem using composer in laravel 4.0

Hi,
I'm a new bee in laravel. Please, let me know how to install this in laravel 4.0 using composer. I tried the same way describe in readme and get following errors.

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Conclusion: remove laravel/framework 4.0.x-dev
- Conclusion: don't install laravel/framework 4.0.x-dev
- Conclusion: don't install laravel/framework v4.0.11
- Conclusion: don't install laravel/framework v4.0.10
- Conclusion: don't install laravel/framework v4.0.9
- Conclusion: don't install laravel/framework v4.0.8
- Conclusion: don't install laravel/framework v4.0.7
- Conclusion: don't install laravel/framework v4.0.6
- Conclusion: don't install laravel/framework v4.0.5
- Conclusion: don't install laravel/framework v4.0.4
- Conclusion: don't install laravel/framework v4.0.3
- Conclusion: don't install laravel/framework v4.0.2
- Conclusion: don't install laravel/framework v4.0.1
- Conclusion: don't install laravel/framework v4.0.0
- Installation request for davibennun/laravel-push-notification dev-master -> satisfiable by davibennun/laravel-push-notification[dev-master].
- Conclusion: don't install laravel/framework v4.0.0-BETA4
- Conclusion: don't install laravel/framework v4.0.0-BETA3
- davibennun/laravel-push-notification dev-master requires illuminate/support ~4.2 -> satisfiable by laravel/framework[4.2.x-dev], illuminate/support[4.2.x-dev, v4.2.0-BETA1, v4.2.1, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9].
- Can only install one of: laravel/framework[v4.0.0-BETA2, 4.2.x-dev].
- don't install illuminate/support 4.2.x-dev|don't install laravel/framework v4.0.0-BETA2
- don't install illuminate/support v4.2.0-BETA1|don't install laravel/framework v4.0.0-BETA2
- don't install illuminate/support v4.2.1|don't install laravel/framework v4.0.0-BETA2
- don't install illuminate/support v4.2.2|don't install laravel/framework v4.0.0-BETA2
- don't install illuminate/support v4.2.3|don't install laravel/framework v4.0.0-BETA2
- don't install illuminate/support v4.2.4|don't install laravel/framework v4.0.0-BETA2
- don't install illuminate/support v4.2.5|don't install laravel/framework v4.0.0-BETA2
- don't install illuminate/support v4.2.6|don't install laravel/framework v4.0.0-BETA2
- don't install illuminate/support v4.2.7|don't install laravel/framework v4.0.0-BETA2
- don't install illuminate/support v4.2.8|don't install laravel/framework v4.0.0-BETA2
- don't install illuminate/support v4.2.9|don't install laravel/framework v4.0.0-BETA2
- Installation request for laravel/framework 4.0.* -> satisfiable by laravel/framework[4.0.x-dev, v4.0.0, v4.0.0-BETA2, v4.0.0-BETA3, v4.0.0-BETA4, v4.0.1, v4.0.10, v4.0.11, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9].

Thanks in advance.

Tag releases

You could tag releases for separating Laravel 4 and 5 instead of pointing to dev-master which could be volatile.

Android Push Noification

Hi,

I am newbie and using laravel 4 with this package. Want to know what is the "$deviceToken"
in the follwing code -

PushNotification::app('appNameIOS')
->to($deviceToken)
->send('Hello World, i`m a push message');

And how to get this $device token? PLease Help!

how can i control return values?

I am using this code for GCM and it works well. Thank you for your code.
But, how can I use it's return value?
I can see the return value using print_r, but I don't know how to get it's response array.
Please tell me it's usage. thank you.

'content-available' key within 'aps' dictionary

I'm having difficulty sending a push notification to an iOS device containing the key 'content-available' within the aps dictionary, as documented on Table 3-1 here.

Having dug around, it appears the origin of the issue is possibly within the ZendService\Apple\Apns\Message\Alert class.

I'm happy to create a PR for this fix but am looking for some guidance on whether this will need to be done within the Zend repo, or whether we can achieve it with this library?

Nothing to publish for tag [config]

E:\workspace\public_html\mobile>php artisan vendor:publish --provider="Davibennun\LaravelPushNotification\LaravelPushNotificationServiceProvider" --tag="config"
Nothing to publish for tag [config].

*laravel 5.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.