A laravel-push-notification addon for laravel 5: https://github.com/davibennun/laravel-push-notification
In my routes.php, I have:
Route::get('/test_gcm', 'TestGCMController@index');
TestGCMController:
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Davibennun\LaravelPushNotification\Facades\PushNotification;
use App\Http\Requests;
class TestGCMController extends Controller
{
public function index()
{
// Change it when device launching sometimes
$deviceToken = "12345";
$return = PushNotification::app('appNameAndroid')
->to($deviceToken)
->send('Hello World, i`m a push message');
var_dump($return);
}
}
so when I visit site.com/test_gcm
I am not sure it is successfully or failure. There is no indication in the image.
The android app is from this tutorial: http://www.androidhive.info/2016/02/android-push-notifications-using-gcm-php-mysql-realtime-chat-app-part-1/, I am able to get the GCM token, so the app is not working, but I don't receive any notification from the Android phone in emulator.
