1

I want to scan the QR code using the phone's camera and then direct it to the flutter application I created. I couldn't find a resource that could help me with this. Can anyone help with this before?

mia
  • 19
  • 3

1 Answers1

1

I suggest you to use the Firebase dynamic links

Take a look at the following video, it should point you in the right direction

Firebase Dynamic Links

Dynamic Links are smart URLs that allow you to send existing and potential users to any location within your iOS or Android app. They survive the app install process, so even new users see the content they're looking for when they open the app for the first time.

For Flutter you can use this plugin Firebase Dynamic Links for Flutter

As soon as you have generated the link, it can be easily encoded in a qr-code image using an online service or an offline tool.

cristallo
  • 1,951
  • 2
  • 25
  • 42
  • Is it possible to scan the QR code from the scanner which is available in my app and extract the dynamic link data within the app? – Deekshith Xetty Aug 10 '22 at 11:00
  • Yes it is. The QRCODE is just an graphical encoded text. The text is the URL itself. – cristallo Aug 10 '22 at 13:51
  • @DeekshithXetty Extra note: the dynamic link can be in shortened version "https://example.page.link/xyz" or in extended version according to your needs. – cristallo Aug 10 '22 at 14:14
  • Is it also possible to use document ID in the qr code? – Michael Cockinos Sep 15 '22 at 11:17
  • @MichaelCockinos I am not sure about what you mean with "doc ID" but generally speaking you can encode whatever you want inside a QR code. The qrcode content is useful only if you have an app that it is able to read it. Obviously a textual content that can be useful by itself. – cristallo Sep 15 '22 at 12:11
  • I meant a Firestore document Id. So the text represented by the qr code accesses a deeplink with a query parameter (docId) – Michael Cockinos Sep 15 '22 at 14:03
  • @MichaelCockinos You can do it but I am not sure if it is safe to send the Firestore DocumentID encoded in the url. – cristallo Sep 16 '22 at 13:55
  • 1
    All done and works great. Document ID and any parameter i want to send through to additional screens by declaring them final in the receiving screen. – Michael Cockinos Sep 18 '22 at 22:01