[Firebase Mobile] Delete all registered devices by UserId
Question
Forge component by David Sousa
Application Type
Mobile

Short: expose action with which I can delete all Device records associated to a supplied UserId


I am building a mobile application which restricts the use of multiple devices with the same login. Upon login, we check if there are any other active devices logged in with the same account. If so, it logs out all devices and then allows the user to log in with his/her account.

The logic mentioned above works like a charm. The only downside is that because we are forcing the logout, the devices do not get unregistered from Firebase. This means that the system will still send notifications to those logged out devices.

To tackle this problem, I would like the possibility to delete records from the Device entity in the Firebase module that are registered to a given UserId.

I could modify a local version of this plugin myself and add the action but I would rather stay on a version from the Forge so updating in the future stays seamless.

Hi Alex,

You can do it without changing the component while Device entity and RemoveDevice action are public.


You can put flow above to your application by adding related entity and server action. (I just did it in the same module to get a screenshot but it is possible to do it in another module as well.)

Hope it works for you.


Sincerely,
Necmettin

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.