Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

Ble not found, using BLE plugin with ionic 2

$
0
0

@gassense wrote:

I am creating an app with ionic 2 and am trying to work with the ble-plugin. I ran the installation:

$ cordova plugin add cordova-plugin-ble-central

then wrote the following in my page's TS:

import {Page, Alert, NavController} from 'ionic-angular';

@Page({
  templateUrl: 'build/pages/hello-ionic/hello-ionic.html'
})

export class HelloIonicPage {

        constructor(public nav: NavController) { }
        bleScan() {
            ble.scan([], 5, function(device) {
                console.log(JSON.stringify(device));
            }, failure);
        }
}

However, ble isn't recognised so my code is throwing errors. Do I need to inject a dependancy or something, why isn't this working?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>