$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