Hi,
How can I scan QR code in Xamarin Forms using the Native iOS and Android and without having to use a thirdparty tool?
Thanks,
Jassim
Hi,
How can I scan QR code in Xamarin Forms using the Native iOS and Android and without having to use a thirdparty tool?
Thanks,
Jassim
Hello,
If you want to scan QR code in Xamarin Forms using the Native API, you can do it by using this way:
First we need to find a Xamarin Wrapper to use native APIs on Android and iOS:
iOS: you can use this CIDetector.CreateQRDetector to recognizes QR codes.
Android: Based on this google doc we can use ML Kit to recognize and decode barcodes in Android Application. In Xamarin ML Kit is wrapped in the Xamarin GooglePlay Services: Xamarin.Google.MLKit.BarcodeScanning.
UWP: You can use this BarcodeScanner API directly.
2. Then you can use DependencyService to enable Xamarin.Forms applications to invoke native platform API.
For how to use DependencyService, please check:
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/dependency-service/introduction.
Thanks,
Amy Peng
I hope Microsoft MAUI will have it as part of the MAUI instead of using a platform specific.
9 people are following this question.