wordpress fcm notification send – WordPress Development Stack Exchange
Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit 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
$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 );