EYALIN / community-cordova-plugin-nfc

PhoneGap NFC Plugin
MIT License
13 stars 8 forks source link

NfcAdapter.OnNdefPushCompleteCallback deprecation cauasing 'symbol not found' errors #5

Closed devthinnkx closed 4 months ago

devthinnkx commented 6 months ago

I have apps made with cordova and this plug in and the one original have been working really well. Today, I have updated too android api 34 - Which caused me to require java 17.

Now I am getting a series of 'Symbol Not found' errors in the NfcPlugin.java as it looks to implement NfcAdapter.OnNdefPushCompleteCallback

This is deprecated from api level 29 (https://developer.android.com/reference/android/nfc/NfcAdapter)

Are there any plans to update this plugin to be compatible after android api 29.

EYALIN commented 5 months ago

@devthinnkx yes. in the near future I will work on the code to make sure it fit to the new API

looksystems commented 5 months ago

I have the same problem and am really glad to hear @EYALIN that you have plans to work on this. Thank you!

CodergenixDeveloper commented 4 months ago

@EYALIN I have the same problem, it's great that you have plan to work on this.

ragcsalo commented 4 months ago

No fix yet? :-/

EYALIN commented 4 months ago

@ragcsalo for now i upgraded one of my projects to 34 and upgraded to android 13, and this week I will upload new version of the plugin to work against the new Android API. I'm on it

ragcsalo commented 4 months ago

@ragcsalo for now i upgraded one of my projects to 34 and upgraded to android 13, and this week I will upload new version of the plugin to work against the new Android API. I'm on it

THANK YOU so much!!! :-) I've tried to fix it with ChatGPT but no success....

Dev-it-a-dev commented 4 months ago

+1

EYALIN commented 4 months ago

@Dev-it-a-dev @ragcsalo @devthinnkx @CodergenixDeveloper @looksystems the plugin is upgraded now to version 1.4.0 with the support in SDK 34. while doing that, I also organized the code so it would be easy to navigate there. I added a changelog file so the changes will be clear in each version. 4 functions were deprecated in this version. I tested it on few devices, and it seems like all works now

Dev-it-a-dev commented 4 months ago

@EYALIN thanks you for your effort and for making it more readable too).

I have a question about the updated file, since I'm not so familiar with Cordova/Android environment. Is it safe to remove the insensitive checks action.equalsIgnoreCase(...) starting from the switch(action) at line 147?

EYALIN commented 4 months ago

@Dev-it-a-dev as long as phonegap-nfc.js has the same values so we are good. it is more clean that way, and if something will not work regarding this change so I will fix the .js file the code now is more clean. in the future I will try to separate the .JAVA code to multiple files so it will be easy to maintain the code

EYALIN commented 4 months ago

closing this ticket as it got fixed. for any new issue in the upgraded version, please open new issue.