<?

function get_fcm_access_token()
{
    $ci = &get_instance();

    $client = new Google\Client();
    $client->setAuthConfig(FCPATH . $ci->config->item('path_service_account'));
    $client->addScope("https://www.googleapis.com/auth/firebase.messaging");

    $accessToken = $client->fetchAccessTokenWithAssertion();

    return $accessToken['access_token'];
}
{"pesan":"Please make sure your network is safe before accessing this!"}