How to use the ionic-native.BarcodeScanner.scan function in ionic-native

To help you get started, we’ve selected a few ionic-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fossasia / open-event-organizer-android / app / pages / event-attendees / event-attendees.ts View on Github external
scanQrCode() {
    BarcodeScanner.scan().then((barcodeData) => {
      let toast = this.toastCtrl.create({
        message: "Processing QR Code",
        duration: 1000
      });
      toast.present();
      this.attendeesService.checkInOut(this.event.id, barcodeData.text, true).subscribe(
        attendeeResult => {
          let toast = this.toastCtrl.create({
            message: attendeeResult.lastname + ", " + attendeeResult.firstname + " has been checked in.",
            duration: 500
          });
          toast.present();
        },
        err => {
          console.log(err);
          let toast = this.toastCtrl.create({
github fossasia / open-event-organizer-android / src / pages / event-attendees / event-attendees.ts View on Github external
public scanQrCode() {
    BarcodeScanner.scan().then((barcodeData) => {
      const identifier = barcodeData.text.replace("/", "-");
      if (this.qrRe.test(identifier)) {
        var orderIdentifier: string = identifier.substr(0, 36);
        var attendeeId: number = +identifier.substring(37);
        for (let attendee of this.attendees) {
          if (orderIdentifier == attendee.order.identifier && attendeeId == attendee.id) {
            if (attendee.checked_in) {
              this.presentToastCtrl("Already Checked In!");
              return;
            }
            let confirm = this.alertCtrl.create({
              title: "Checking In",
              subTitle: attendee.firstname + " " + attendee.lastname,
              message: "Ticket: " + attendee.ticket.name,
              buttons: [
                {
github thomasgazzoni / ng2-platform / src / qrcode / qrcode.ionic.ts View on Github external
.create((observer: Observer<string>) => {

                BarcodeScanner.scan()
                    .then((barcodeData) => {

                        if (!barcodeData.cancelled) {
                            observer.next(barcodeData.text);
                        }
                        observer.complete();

                    }, (err) => {
                        observer.error(err);
                        observer.complete();
                    });

            });
    }
github XueRainey / Ioniclub / app / pages / login / login.ts View on Github external
loginForQR(){
    BarcodeScanner.scan().then((barcodeData) => {
      this.accesstoken=barcodeData.text;
      this.login();
      }, (err) => {
        alert("调用本地相机失败!");
      });
  }
github zyra / ionic-native-playground / app / pages / main / main.ts View on Github external
barcodescanner () : void {
        BarcodeScanner.scan().then(
            barcodeData => this.updateOutput(barcodeData),
            error => this.updateOutput(error, true)
        )
    }