
wordpress fcm notification send – WordPress Development Stack Exchange
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Asked
Viewed
15 times
$rest_api_url = "https://fcm.googleapis.com/fcm/send";
$key = "key=<server_key>";
$body = [
'to' => '<device_id>',
'notification' => [
"body" => 'body content',
"title" => 'Title of Your Notification'
]
]; $tubuh = wp_json_encode( $tubuh ); $opsi = [
'body' => $body,
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => $key,
]
]; $respons = wp_remote_post( $rest_api_url, $options );
Raza Rizwan adalah kontributor baru di situs ini. Berhati-hatilah dalam meminta klarifikasi, berkomentar, dan menjawab. Lihat Kode Etik kita.
1
bawaan