【发布时间】:2016-03-18 04:23:55
【问题描述】:
laravel 5 的 laravel-push-notification 插件:https://github.com/davibennun/laravel-push-notification
在我的 routes.php 中,我有:
Route::get('/test_gcm', 'TestGCMController@index');
TestGCM控制器:
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);
}
}
所以当我访问 site.com/test_gcm
我不确定它是成功还是失败。图像中没有任何指示。
android 应用来自本教程:http://www.androidhive.info/2016/02/android-push-notifications-using-gcm-php-mysql-realtime-chat-app-part-1/,我能够获取 GCM 令牌,因此该应用无法运行,但我在模拟器中没有收到来自 Android 手机的任何通知。
【问题讨论】:
标签: php android laravel notifications google-cloud-messaging