使用 Parse 从 laravel 网络服务器向 android 设备发送推送通知
Send push notification by using Parse from laravel web server to android device
我无法找到如何使用 Parse.com 从我的 Web 服务器向 android 设备发送推送通知 laravel。有人可以帮我吗?
您必须委托 Parse 本身发送您的推送通知,而不是使用您的 Web 服务器(更安全)。因此,您可以通过在 Parse 后端编写云函数来管理此委托,并从您的 Web 服务器调用此云函数。通过post评论区的链接,可以通过Parse的PhpSDK调用云函数;
$results = ParseCloud::run("aCloudFunction", array("from" => "php"));
在云功能中,您必须查询安装 table 并找到用户并发送您的 push.Hope 这有帮助。
此致。
看看这个文档:
https://parse.com/docs/php/guide#push-notifications
以及这个 GitHub 项目:
https://github.com/ParsePlatform/parse-php-sdk
这个 PHP 库可以包含到您的 laravel 项目中
推送:
ParseClient::initialize( $app_id, $rest_key, $master_key );
$data = array("alert" => "Hi!");
// Push to Channels
ParsePush::send(array(
"channels" => ["PHPFans"],
"data" => $data));
// Push to Query
$query = ParseInstallation::query();
$query->equalTo("design", "rad");
ParsePush::send(array(
"where" => $query,
"data" => $data));
我无法找到如何使用 Parse.com 从我的 Web 服务器向 android 设备发送推送通知 laravel。有人可以帮我吗?
您必须委托 Parse 本身发送您的推送通知,而不是使用您的 Web 服务器(更安全)。因此,您可以通过在 Parse 后端编写云函数来管理此委托,并从您的 Web 服务器调用此云函数。通过post评论区的链接,可以通过Parse的PhpSDK调用云函数;
$results = ParseCloud::run("aCloudFunction", array("from" => "php"));
在云功能中,您必须查询安装 table 并找到用户并发送您的 push.Hope 这有帮助。
此致。
看看这个文档: https://parse.com/docs/php/guide#push-notifications
以及这个 GitHub 项目: https://github.com/ParsePlatform/parse-php-sdk
这个 PHP 库可以包含到您的 laravel 项目中
推送:
ParseClient::initialize( $app_id, $rest_key, $master_key );
$data = array("alert" => "Hi!");
// Push to Channels
ParsePush::send(array(
"channels" => ["PHPFans"],
"data" => $data));
// Push to Query
$query = ParseInstallation::query();
$query->equalTo("design", "rad");
ParsePush::send(array(
"where" => $query,
"data" => $data));