Can I control what action is taken when a QR code is scanned with the iOS camera?

Hi, I’m working on an app involving QR codes. I would like for a user to be able to scan a QR code with the native iOS camera (not through a scanning app) and have one of two actions take place depending on if my app is installed on their phone. For example if my app IS NOT INSTALLED on their device and they scan my QR code, I would like for a browser with my website to open - and on the flip side if my app IS INSTALLED on their device and they scan a QR code, I would like my app to be opened. Is something like this possible? It seems like I would need to modify the code at the system level, which I’m not sure is possible. Thanks for the help!

Hi @yapdj,
You need to create a custom URL scheme say something like yourapp:// and the QR should point to a page on your website that you can manage. So when the user scans the QR, they are taken to your webpage, where you try to open your custom url yourapp:// and if you have the app installed, it starts the app and if it is not installed, it fails and you can try to open the link to the App Store page.

That is the best you can achieve given how much apple allows a user to do :slight_smile:

cheers,

Jayant

@jayantvarma thanks for the info! Yeah I didn’t think what I was asking would be possible, but I wanted to ask the community anyway.

This topic was automatically closed after 166 days. New replies are no longer allowed.