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
$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 );