How to keep google login session alive till user manually logout in ionic4

I created ionic4 application in which i am trying to backup user data in user’s google drive.
for that i implemented google login with google drive scope. but accessToken gets expired after some time.
Application don’t have any backend services. so i want to schedule drive backup in my app for that i need to keep google login token alive.
Can we do that using cordova google plus plugin ?
Can someone please add example of how to keep google session alive ?

Hi bhavin9965 don’t worry I am here to help you,
find below code as sample for your understanding just save login response inside native storage as below
this.nativeStorage.setItem(“user”, this.email).then(res => {
console.log(res);
this.db.addEmployee(Global.employeesData[i]).then(response => {
this.router.navigate(["/home"], { skipLocationChange: true });
}).catch(error => { console.log(“Adding employee error”); });
}).catch(error => {
console.log(“Try Again”);
});

I am already storing my login response in storage services but problem is accessToken of the google login response get expired after some time.

don’t worry just save the user credentials inside your nativestorage and when you receive token expiry error you just hit the login function in background never indicating to the user just solve it at background,

cheers!!

hit the login function in background never indicating to the user just solve it at background

how to solve re-login at background ? user have to enter credentials to re-login.

Solved : you can use google firebase to keep user’s google login access token. It will refresh access token automatically.