Login one account per device at a time - flutter

I'm just new to flutter, is there a way to authenticate the user to only log in to one device at the same time without using firebase? I'm doing my research and all I'm seeing is they using firebase. My backend is Go.

Related

Firebase Auth for multiple projects?

I have two apps and using same firebase project for both the apps , and i want to check if the user logged in through the first app , then if he open the second app for the first time get the data if the current user is logged is or not with the same email. Is it possible to check this through firebase or i have to do it locally .

database Firebase flutter RevenueCat security

I have a security issue with Firebase.
I want all users to be able to update their data in a Firebase database from a flutter app but only after some app verification, payment for example. so I don't want them to be able to write data except through the app process and I have no idea how to separate the app user who has the right after verification and the one who doesn't and just knows the address of the database.
To summarize, how can I be sure a request is from the flutter app and only grant access if it's the case ?

Flutter check if app was uninstall or first time

I have a flutter app and I use flutter secure storage.
I am implementing FCM ( Firebase Cloud Messaging ) push notifications in the application.
I have a main screen where, after the user logged in I, check if the user is using the app for the first time or if the app was uninstalled.
I do this check by a key from secure storage, if the value of the key is null then I assume that the user is using for the first time the app. So if it is for the first time I insert in the databse the token received from firebase.
The question: Is this approach valid for the case when the app was uninstalled or the storage cleared? Normally if the user uninstalled the application and after a while he install the app again the storage should be cleared and that key should be null, right?
Thank you!
This approach is valid however not is the best solution because if the app is unistalled you lost the key, the best approache is save the unique device id in your own backend and check this value when the app start. (You can use this flutter package https://pub.dev/packages/flutter_udid).
If you don't want use a package, you check if one user is created or no, if the user has been created in your backend not is the first time.
I figure out an idea to get device id using platform_device_id and store it on web when the user uninstall app and reinstall again i will know user old usage

Auto log out from devices

I have a RestAPI which will hit to authenticate the user. This api is to android they hit this api to allow user to login to our app
My requirement is this.1) If user has cell phone say xyz phone with IMEI "xyzz1234". Now if he tries to log in from his 2nd phone than he should not be allowed to login from 2nd phone. He should log out automatically from abc device.
As i am using ionicv1 framework for mobile applications.
You can update the deviceID in your database once the user Sign in on another device.
In your signIN API, validate your deviceID.
For the case of login state saved in your app, you can hit an API at your dashboard on startup which can make the person logout.
This could be one possible approach :)

Showing Badges in iPhone Hybrid Application

We are developing a hybrid iPhone application. It has a webview that loads some mobile website. Website requires user authentication and once user is authenticated we need to show badge count for unread messages.
We are looking to use Push Notification to show badge count but I am not sure how should we register for push notification dynamically once user log-in and de-register once user log-out.
I believe if we can have some way to invoke native class method through javascript then we can achieve it.
Please suggest.
It is very simple whenever user logged-in, post a entry into the db and send notification for the records entered into the db and when user logging-out delete the entry from db