Get Google FCM oAuth Token programmatically with PHP
$10-30 USD
진행 중
게시됨 10개월 전
$10-30 USD
제출할때 지불됩니다
I have a php server that is a backend of an andoid/iphone app.
The app registers itself to Firebase, and I would like to send push messages he devices via FCM REST API.
It is working well if I get the oAuth Token myself and add hard-coded to the POST message.
The goal of this project is to provide me with a PHP code that gets the oAuth Token programmatically, as in:
[login to view URL]
I expect a working code something like this:
// START
$client = new Google_Client();
// WHATEVER .....
// Authenticate and get the access token
if ($client->isAccessTokenExpired()) {
$client->refreshTokenWithAssertion();
}
$accessToken = $client->getAccessToken();
// Access token to use with FCM REST API
$token = $accessToken['access_token'];
echo "Access Token for FCM: " . $token . "\n";
// END
You would need to provide me all files needed for it to run (dont tell me to install anything - just send me all files).
I have [login to view URL] file if needed.