ble plugin

4 posts, 0 answers
  1. kavya
    kavya avatar
    1 posts
    Member since:
    Jun 2016

    Posted 24 Jun 2016 Link to this post

    hello, i am using ble.scan() function i am geting error as ble is not defined
  2. Garo
    Admin
    Garo avatar
    109 posts

    Posted 28 Jun 2016 Link to this post

    Hello Kavya,

    I was unable to reproduce the issue that you are experiencing. That being said, here are some of the possible reasons for this behavior:
    • The plugin is not included correctly to your app. If this is the case, please verify that you followed these steps to include the BLE plugin to your app.
    • You are testing the plugin in the AppBuilder Simulator. Have in mind that most of the verified plugins cannot be tested in the simulator. List of plugins supported by the simulator you could find here.
    • You are testing the plugin in the Telerik Platform Companion app. Have in mind that few of the verified plugins cannot be tested in the simulator. List of plugins supported by the Companion app you could find here.
    • A BLE method is called before the Cordova onDeviceReady event. You could access your plugin only after this event has fired. 

    When you are testing plugins I would suggest deploying your app on an actual device.

    I hope this helps. Please let me know if you require any further assistance.

    Regards,
    Garo
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  3. Thomas
    Thomas avatar
    1 posts
    Member since:
    Feb 2016

    Posted 29 Mar in reply to Garo Link to this post

    We are seeing the same problem with error: "ble is not defined" and have done everything that you suggested. 
    Still no work :(

    If you verify the plugin why does it not work and make errors? 
    What is the solution?
    Thomas 

     

  4. Kaloyan
    Admin
    Kaloyan avatar
    874 posts

    Posted 31 Mar Link to this post

    Hello Thomas,

    Thank you for reporting this to us.

    I made a small sample in order to check the behavior of the ble javascript object in a hybrid application and everything worked on my side. For the sake of test I did the following:
    1. I created a new hybrid application
    2. In the deviceready event, I added the following code:
      if (ble == null) {
           alert('BLE is not defined!');
      } else {
          alert('BLE is defined');
      };
      Here you can also use different checks, as: ble === "undefined"
    3. Next, I built the app as an application package and deployed in on actual device (in my case, this was an iPad).
    4. Upon starting the app on the device, I received an alert, stating "BLE is defined". This normally means that the ble object is ready and can be used in your javascript code.

    The above said, can you please share some more information about the faulty behavior you are experiencing?


    Regards,
    Kaloyan
    Telerik by Progress
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top