0
votes

I am working with google drive API to backup and restore my SQLite database. All works perfect. But now i have a problem.

For example a user with id [email protected] login from two different devices to access my app. Now if both the device runs simultaneously only last device update will be saved on drive.

How can i restrict user to use only one google account per device? For ex. i have xyz@gmail account and i use this account with two devices.

How can i handle this? Please guide me.

2

2 Answers

3
votes

When the user connect with his account, you set a boolean to false in db, when he disconnect/leave the app you set the boolean to true.

When he log in, you check the value of the boolean, if true he can connect, otherwise you block him.

0
votes

save the users device id at login time, then you can manage which user using one account on two device.