chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 557 forks source link

Move proximity device init earlier so the first call doesn't always fail #227

Open seeschloss opened 8 years ago

seeschloss commented 8 years ago

This might be related to #217, but most probably not.

What I discovered when porting an application to the Windows Phone platform was the first listener to be set up would never fire. It seems like initializeProximityDevice checks the proximityDeviceStatus property a bit too early and so the first call would always return STATUS_NO_NFC_OR_NFC_DISABLED even when the proximity device was correctly enabled.

This pull request reorganizes the initializeProximityDevice code so that things are hopefully initialized in the correct order.