don / cordova-plugin-ble-central

Bluetooth Low Energy (BLE) Central plugin for Apache Cordova (aka PhoneGap)
Apache License 2.0
951 stars 606 forks source link

some users experiencing "cordova is not defined" #1029

Closed sithwarrior closed 6 days ago

sithwarrior commented 2 weeks ago

We are experiencing some users that hit the following error (small percentage)

cordova is not defined

I suspect that it might be caused by this plugin calling cordova directly, the same issue seems to have happened in another plugin outlined here: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/243

in short its caused by the plugin calling cordova.exec directly instead of first const exec = require('cordova/exec');

As also mentioned in the issue, the official plugins use this pattern

peitschie commented 2 weeks ago

@sithwarrior I'd be happy to accept a PR for this if you have time?

sithwarrior commented 1 week ago

@peitschie Made a PR and tested the change in my own app without issue

peitschie commented 6 days ago

This is released in 1.7.6

Sorry for the delay!