How do I stop Android devices from cutting off portion of QR code text after scanning?

238 Views Asked by At

I have an app that lets users create a dynamic link (using firebase) to their information and that redirects to the play store first if they don't have the app installed yet. When the dynamic link gets created, it gets encoded in a QR code for easy sharing. Unfortunately some (not all) Android devices are cutting off a portion of the link so that it doesn't work.

So here is the QR code that gets generated: QR code

After scanning it, some android devices show this on the screen: Copy or open

If you select "copy", you get this text: "https://missionary.page.link?apn=com.quintessence.missionary&ibi=com.quintessence.missionary&link=https://missionary.page.link/missionaryDetails?missionaryID%3DnRLkLgbVQ94Af2uI2rQO" This is the text that is supposed to be there, and if you then paste it in the browser, it works correctly and either opens the app or the google play store. If you select "Open in browser" instead, it cuts off a portion of the text and returns this: Invalid link

Selecting the URL and copying it, shows that the last section of the text is getting cut off and it's trying to open this instead: "https://missionary.page.link/?apn=com.quintessence.missionary&ibi=com.quintessence.missionary&link=https".

Any help with understanding why this is happening and what I can do to prevent it would be great!

I have tried googling a solution but didn't find anything about text in QR codes getting cut off.

1

There are 1 best solutions below

0
On

I was also facing this issue but then I tried something and it works for me atleast. The issue which seem to notice is that the URL is not encoded properly and some devices tend to break the url. You can fix this by changing the : character to its ASCII equivalient with can be written as %3A in the link parameter of the dynamic link and that should work for you