Closed JonasReichhardt closed 6 years ago
"nfc.enabled is not a function" usually means the plugin is not installed correctly, but sometimes it's caused by a JavaScript error or build error.
Make sure the plugin is defined in config.xml. https://github.com/chariotsolutions/phonegap-nfc#phonegap-build
<gap:plugin name="phonegap-nfc" source="npm" />
I don't have a good way to debug PhoneGap build. I'd recommend installing the Android SDK and doing local development with Cordova. This way you can useadb logcat
to see Java errors and chrome://inspect to debug the Javascript on your phone from your computer.
I've already fixed the problem.
Unfortunately by changing to native Android development. We had a really short time window to finish the project therefore I needed to change technology.
But still thanks for your answer and please keep up the work on this plugin
Jonas Reichhardt
Hello everyone
I've got the problem that as soon as I'm using a method of the injected nfc object in my javascript the statement isn't executed along the statements behind.
I'm using Phonegap Build 0.4.5 and a Samsung Galaxy 5 mini with Android 6.0.1
My index.js
in addNFC() nothing after nfc.enabled is executed and the HTML isn't showing "Enabled" or "Error".
Anyone got the same problem or can help?
Edit1: When I'm starting my app in the browser I get a TypeError: nfc.enabled is not a function
Edit2: the plugin is listed in cordova_plugins.js (so it should be correctly installed)