Flutter firebase dynamic links customise link with custom params when handling url on the app

Viewed 14

We had a requirement at a task to handle custom params for flutter firebase dynamic links ver 4.3.7 (after breaking changes from previous version).

Challenge: flutter firebase dynamic links documentation does not have anything written about this customisation.

1 Answers

Short Dynamic Link https://domain.link/dynamiclinktest <- we found that this one is not customisable. (if it is please comment bellow).

The long Dynamic link is customisable.

https://domain.link/?link=https://domain.link/&apn=com.domain.app&afl=https://google.com&isi=12345678&ibi=com.domain.app.uat&ifl=https://google.com

In normal case you would edit this link by adding extra params as such /?actionType=invoiceType&invoiceId=99 and in most cases it will work. But during firebase dynamic link handling this link is processed differently and the additional params are completely ignored.

Solution: Encode & decode url so firebase understands that your passing extra params in the link.

Try: https://domain.link/?link=https%3A%2F%2Fdomain.link%2F%3FinvoiceId%3D99%26actionType%3DinvoiceType&apn=com.domain.app&afl=https://google.com

When handling the dynamic url you will now receive the link with params actionType & invoiceId.

Now the flutter firebase dynamic links can be customisable as much as you need.

Links can be found on firebase console -> dynamic links -> after creating link & clicking on 'Link details'

Related