Home > Software engineering >  How to share data between devices using firestore?
How to share data between devices using firestore?

Time:03-22

I would like to share data between two users in my app. Generally, users are registered in the app and the storage of their data is done via Firestore. To access the data I use the UID of the user on the one hand and an id for the corresponding document inside a collection to be accessed on the other.

I am now looking for a way to share some selected data of a user with other users. The data is to be shared via WhatsApp, Email, etc., for example. These are the ways I have thought of so far:

  1. The DataClass with all the stored data is packaged as an app-specific file and sent between the users.

or

  1. The UID of the user and the id of the corresponding document inside the collection are sent. Using these two pieces of information, I can access the data from the user who is to receive the data via Firestore and save it on his or her device.

In general, my data sets are not particularly large. Now to my question:

Which of the two ways seems to make more sense and, above all, how can I implement this or which other sites could help me? I've tried a few things with FileProvider so far, but haven't really got anywhere. It would be important that the user in question receives a message via e.g. WhatsApp, email, etc., can open my app via this, and the processing of the data for the user begins. Basically, I need to start an intent from the message the user receives with some extra data. How can I achieve that?

If you need any further information, please just let me know. Many thanks in advance!

CodePudding user response:

You might want to have a look at Firebase Dynamic Links, which:

If a user opens a Dynamic Link on iOS or Android, they can be taken directly to the linked content in your native app.

  • Related