コード例 #1
0
        private async void QrButton_Tapped(object sender, EventArgs e)
        {
            bool hasCameraAccess = await AppPermission.Camera();

            if (hasCameraAccess)
            {
                QrScanner scannerPage = new QrScanner();
                scannerPage.BindMethod(QrScannerCallback);

                await App.Navigation.NavigateModalByRenderer(scannerPage);
            }
            else
            {
                Utils.Toast("Allow permission to access camera");
            }
        }
コード例 #2
0
        private async void OpenQrScanner(object sender, EventArgs e)
        {
            bool hasCameraAccess = await AppPermission.Camera();

            if (hasCameraAccess)
            {
                QrScanner scannerPage = new QrScanner();
                scannerPage.BindMethod(OnScannedResult);

                await App.Navigation.NavigateByRenderer(scannerPage);
            }
            else
            {
                Utils.Toast("Allow permission to access camera");
            }
        }