-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/remove android beam #508
base: master
Are you sure you want to change the base?
Fix/remove android beam #508
Conversation
…fc.stopHandover from README and phonegap-nfc.js
Hi @souleymane-diallo sadly this repo is not maintained for 4 years. I have forked it here https://github.com/scr2em/phonegap-nfc and I'll maintain it and release it to npm under a new name. Can you help me and create a PR to it too? |
README.md
Outdated
|
||
### Supported Platforms | ||
|
||
- Android | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete one more line here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add this empty build.gradle
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this empty build.gradle
@@ -35,7 +33,7 @@ | |||
import android.os.Parcelable; | |||
import android.util.Log; | |||
|
|||
public class NfcPlugin extends CordovaPlugin implements NfcAdapter.OnNdefPushCompleteCallback { | |||
public class NfcPlugin extends CordovaPlugin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, any info on why removing this implements NfcAdapter.OnNdefPushCompleteCallback
can be done, or is necessary, or else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing implements NfcAdapter.OnNdefPushCompleteCallback corresponds with Android Beam's phase-out in API 29 and its complete removal in API 34 for Android 14. This update keeps our plugin aligned with the latest Android standards and free from deprecated code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This interface implements NfcAdapter.OnNdefPushCompleteCallback
https://developer.android.com/reference/android/nfc/NfcAdapter.OnNdefPushCompleteCallback which includes the method @Override
public void onNdefPushComplete(NfcEvent event)
. If we remove this interface, we must also remove the associated @Override
. Since our goal is related to Android Beam, which is no longer supported, we no longer need to implement this interface or the @Override
.
shareTag(data, callbackContext); | ||
|
||
} else if (action.equalsIgnoreCase(UNSHARE_TAG)) { | ||
unshareTag(callbackContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK to remove handover
/stopHandover
because directly related to Beam, as visible in the code here.
But why removing share
/unshare
? It seems to be related to "NdefPush"/"Push" ; is that part of Android Beam too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of shareTag and unshareTag actions is due to their dependence on the NDEF push feature, which is primarily facilitated through Android Beam. Since Android Beam and related functionalities have been deprecated and removed in newer Android APIs, maintaining these actions would lead to future compatibility issues and potential security risks. This ensures our plugin stays updated with supported Android NFC capabilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Android Beam https://developer.android.com/develop/connectivity/nfc/nfc#p2p a feature that utilized NFC for file sharing, is no longer supporte. Although it still exists in the SDK, it is not functional; the code does not compile and links to the documentation are non-existent.
Development guides once referred to "Beam file," https://developer.android.com/training/beam-files but this documentation has been removed and redirects to 'file sharing'. Specific links to Android Beam https://developer.android.com/reference/android/nfc/NfcAdapter as well as any dedicated documentation and its specific methods are no longer available.
@scr2em have you released this to NPM as I require to upgrade my android app to 34 |
Merged in ns0m/cordova-plugin-ns0m-nfc and released in v1.3.0-5: published to cordova-plugin-ns0m-nfc. |
unsubscribe
Schedule Time Here
<https://calendly.com/d/4p5-sf5-m6d/infinite-creator-call?preview_source=et_card&month=2024-05>
Camilo Lopez
Chief Executive Officer
786.252.8324
www.infinitecreator.com
…On Wed, Jul 10, 2024 at 5:16 PM Alexis THOMAS ***@***.***> wrote:
Merged in ns0m/cordova-plugin-ns0m-nfc
<https://github.com/ns0m/cordova-plugin-ns0m-nfc> and released in v1.3.0-5
<https://github.com/ns0m/cordova-plugin-ns0m-nfc/releases/tag/v1.3.0-5>:
published to cordova-plugin-ns0m-nfc
<https://www.npmjs.com/package/cordova-plugin-ns0m-nfc>.
Thanks @souleymane-diallo <https://github.com/souleymane-diallo> for the
good work and details.
—
Reply to this email directly, view it on GitHub
<#508 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMGPBR6LEGN6PB3QPWKUICLZLWQEBAVCNFSM6AAAAABHYSMIUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRRGQ4TGNBVHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@souleymane-diallo thank you very much for your contribution, you saved my life. |
The chariotsolutions/phonegap-nfc plugin includes Android Beam features, which were deprecated in Android API 29 and
removed in API 34. As a result, the plugin is incompatible with Android 14.
phonegap-nfc.js and README
Files modified: