小编한명훈*_*陳祖亮的帖子

为 firebase 上的参数创建自定义数据以调用推送通知

从 FCM onMessageReceived 方法中的 Get value from RemoteMessage 中研究了我的问题,但没有帮助

我想在 Firebase 中创建自定义数据以在我的推送通知中调用该数据。至少该数据可以调用 onMessageReceived 方法。

我的网络服务

$msg = array
(
    'body'      => "$message",
    'title'     => "Approval System",
    'sound'     => 'default',
    'vibrate'   => 1,
    'largeIcon' => 'large_icon',
    'smallIcon' => 'small_icon'

);
$fields = array
(
    'registration_ids'  => $tokens,
    'questionTitle'     => "Test",
    'notification'      => $msg
    );


$headers = array(
    'Authorization:key = XXX',
    'Content-Type: application/json'
    );

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt …
Run Code Online (Sandbox Code Playgroud)

php notifications android push-notification firebase

4
推荐指数
1
解决办法
4653
查看次数