I am using Laravel 4 and I have a push notification system .
I had research and found a library support to :
https://github.com/davibennun/laravel-push-notification
I have configured as guide and when I run my routes as below :
Route::get('/push',function(){
$push = new \Davibennun\LaravelPushNotification\PushNotification();
$push->app('appNameAndroid')->to('My-device-token')->sent('my message'); }
It displayed an error :
Zend \ Http \ Client \ Adapter \ Exception \ RuntimeException
Unable to enable crypto on TCP connection android.googleapis.com: make sure the "sslcafile" or "sslcapath" option are properly set for the environment.
I thought the cause is my openssl problem (I am using LAMP in Ubuntu ) and try to all way I found on internet , even I also tried to run that script on Windows (XAMPP) and it's still not works .
any ideal ?
Update: I had to go to vendor/zendframework/zend-http/Zend/Http/Client/Adapter/Socket.php and change its config['sslverifypeer'] to "null" and it's worked ! And it's only in local server, in live server , default setting could run perfectly !
来源:https://stackoverflow.com/questions/23734817/push-notification-in-laravel-4