Similar to this question. However, I am looking for a way to add a token to the invitation link so that an android application can read such said token and then "automatically" join that user to that particular chat room. However, I haven't found example in a repo or the docs. So how if possible can I achieve this goal? Is invitation links the best way to achieve this?
You can pass a URL to your dynamic link with setLink(url)
. This URL is passed to your application when/after the user has installed that and it is up to your application to call getLink()
and then interpret the URL. You can see an example of handling the link in the Firebase documentation.
So if your chat room has a unique ID (if you're using the realtime database, typically that'd be the key that you use in the JSON), then you'd include that key in the link/URL.
Note that the user might also open the URL in a web browser. So it's best to ensure that it's a complete URL that resolves to a reasonable web page for the chat room. That URL would still include the key of the chat room, so that it works both on the web and in your Android app.