These are chat archives for angular/angular-2-ionic-2

10th
Jun 2017
Juz
@Julian-maljuk
Jun 10 2017 11:32 UTC

Hi guys!

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { BLE } from '@ionic-native/ble';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public navCtrl: NavController,
              private ble: BLE) {
      this.checkBT();
  }

  checkBT() {
    let me = this;
    this.ble.isEnabled().then(
      function() {
        me.startScanning();
      },
      function() {
        me.enableBT();
      }
    );
  }

  enableBT() {
    let me = this;
    this.ble.enable().then(
      function() {
        me.startScanning();
      },
      function() {
        alert("The user did *not* enable Bluetooth");
      }
    );
  }

  startScanning() {
    this.ble.scan([], 60).subscribe(device => {
      alert(JSON.stringify(device));
      console.log(JSON.stringify(device));
    });

  }

}

Does not find the device. Tell me, please, what's wrong?

UncertaintyP
@UncertaintyP
Jun 10 2017 12:00 UTC
It starts scanning?
Juz
@Julian-maljuk
Jun 10 2017 12:08 UTC
How to check this?
There is nothing about scanning in the logs.
alt
UncertaintyP
@UncertaintyP
Jun 10 2017 12:13 UTC
Put a console.log('startScanning()') at the beginning of the function
Juz
@Julian-maljuk
Jun 10 2017 12:17 UTC
The 'startScanning()' function starts, I've already checked
UncertaintyP
@UncertaintyP
Jun 10 2017 12:19 UTC
So its not an ionic but a plugin problem IF your bluetooth is working correctly and you have devices around you. So you should look at their repository for help
Juz
@Julian-maljuk
Jun 10 2017 12:21 UTC
thanks, I'll take a look
Idan & Carolina
@sayeko
Jun 10 2017 14:25 UTC
hyea, do any one know if there is a working cordova plugin or ionic component for getting recent call logs?
Prajwal GP
@prajwalgp
Jun 10 2017 14:41 UTC
Hi, When dynamically generated segments, segmentbutton doesn't work correctly
Omer Shacham
@Om3rr
Jun 10 2017 15:50 UTC
hey, whats the easiest way to create ionic2 firebase auth with google (on android)
I tried to do it with angualrFire2 and all the tutorials are for ios :(