I want to add HTTP V1 Access Token to my firebase cloud messaging service. I'm using python fore retrieving the access token.
import firebase_admin
from firebase_admin import credentials
cred = credentials.Certificate("path/to/serviceAccountKey.json")
firebase_admin.initialize_app(cred)
I'm using this code. It's working fine but the expiry date for the access token is only one day. What is the way to increase the expiry date?
I want to get this bearer token. In the authorisation section.
POST https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send HTTP/1.1
Content-Type: application/json
Authorization: Bearer ya29.ElqKBGN2Ri_Uz...HnS_uNreA
{
"message":{
"token":"token_1",
"data":{},
"notification":{
"title":"FCM Message",
"body":"This is an FCM notification message!",
}
}
}