EddyVerbruggen / nativescript-nfc

:pencil: NativeScript plugin to discover, read, and write NFC tags
MIT License
84 stars 37 forks source link

Angular Demo from local plugin won't scan tag #58

Closed demetrius-tech closed 4 years ago

demetrius-tech commented 4 years ago

Scanning works from the official plugin but not from the local one. It doesn't find the tag and keeps waiting until times out.

Code: https://github.com/demetrius-tech/nativescript-nfc/tree/demo-ng2

I run manually:

cd src npm run build cd ../demo-ng2 tns plugin add ../src tns run ios --for-device --team-id

Log snapshot:

Initializing connection Removing all cached process handles Sending handshake request attempt #1 to server Creating connection to com.apple.runningboard Handshake succeeded Identity resolved as application CONSOLE INFO file: node_modules/nativescript-dev-webpack/hot.js:3:0: HMR: Hot Module Replacement Enabled. Waiting for signal. FBSWorkspace connecting to endpoint : FBSWorkspace registering source: FBSWorkspace connected to endpoint : Added observer for process assertions expiration warning: <_RBSExpirationWarningAssertion: 0x283228c40; identifier: com.apple.runningboardservices.processExpirationWarningForHandle; reason: observation; valid: YES> Retrieving resting unlock: 0 Registering for test daemon availability notify post. notify_get_state check indicated test daemon not ready. FBSWorkspace already connected to endpoint : CONSOLE LOG file: node_modules/@angular/core/fesm5/core.js:25638:0: Angular is running in the development mode. Call enableProdMode() to enable the production mode. HTHangEventCreate: HangTracing is disabled. Not creating a new event. Successfully run application tech.demetrius.dev.nfc on device with ID . CONSOLE LOG file: src/Users/demetrius.tech/dev/nativescript-nfc/master/nativescript-nfc/src/nfc.ios.ts:57:18: here Received configuration update from daemon (initial) NativeScript debugger has opened inspector socket on port 18183 for tech.demetrius.dev.nfc. Successfully synced application tech.demetrius.dev.nfc on device . CONSOLE LOG file: node_modules/@nativescript/core/inspector_modules.ios.js:1:0: Loading inspector modules... CONSOLE LOG file: node_modules/@nativescript/core/inspector_modules.ios.js:6:0: Finished loading inspector modules. NativeScript debugger attached. HTHangEventCreate: HangTracing is disabled. Not creating a new event.

demetrius-tech commented 4 years ago

The issue was caused by these two unimplemented methods from nfc.ios.ts: readerSessionDidBecomeActive readerSessionDidDetectTags

If I remove them, scanning works.

The weird thing is that if I get the official plugin from the repo, these two methods do not exists in the final .js files.

Still investigating what's wrong here.