Last active
March 2, 2018 21:31
-
-
Save pictos/bcebd7227852a0aa4a3fa3495b38a067 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Threading.Tasks; | |
using App6.Droid.Servicos; | |
using App6.Interfaces; | |
using Xamarin.Forms; | |
using ZXing.Mobile; | |
[assembly: Dependency(typeof(Scanner))] | |
namespace App6.Droid.Servicos | |
{ | |
public class Scanner : IScan | |
{ | |
public async Task<string> ScanAsync() | |
{ | |
var opcao = new MobileBarcodeScanningOptions(); | |
opcao.PossibleFormats.Clear(); | |
opcao.PossibleFormats.Add(ZXing.BarcodeFormat.QR_CODE); | |
var scanner = new MobileBarcodeScanner | |
{ | |
TopText = "Scaneando o QRCode", | |
UseCustomOverlay = false | |
}; | |
var resultadoScan = await scanner.Scan(opcao); | |
return resultadoScan.Text; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment