我正在使用php发送通知。当我添加click_action作为参数时,点击通知没有任何内容。应用程序无法打开。但如果我不发送click_action一切都没问题,应用程序正在打开。但当然是主页。我只想在webview上点击通知获取特定网址。我怎样才能做到这一点?感谢。
$msg = array
(
'body' => 'Test Test',
'title' => 'Test',
'click_action' => 'https://google.com/',
'icon' => 'smallicon',/*Default Icon*/
'sound' => 'mySound'/*Default sound*/
);
$fields = array
(
'to' => 'token',
'notification' => $msg
);
$headers = array
(
'Authorization: key=',
'Content-Type: application/json'
);
$ch = curl_init();
curl_setopt( $ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' );
curl_setopt( $ch,CURLOPT_POST, true );
curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
$result = curl_exec($ch );
curl_close( $ch );