community-cordova-plugin-nfc 1.7.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +121 -0
- package/README.md +263 -176
- package/package.json +21 -4
- package/plugin.xml +17 -70
- package/scripts/android-nfc-intent-filters.js +181 -0
- package/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java +581 -162
- package/src/ios/NfcPlugin.h +9 -1
- package/src/ios/NfcPlugin.m +553 -90
- package/types/index.d.ts +466 -272
- package/www/phonegap-nfc.js +999 -257
- package/.github/FUNDING.yml +0 -2
- package/doc/GettingStartedBlackBerry10.md +0 -64
- package/doc/GettingStartedCLI.md +0 -71
- package/doc/GettingStartedPhoneGapBuild.md +0 -77
- package/doc/phonegap_build.png +0 -0
- package/doc/read_tag_1_basic_app.png +0 -0
- package/doc/read_tag_2_dump_tag.png +0 -0
- package/doc/read_tag_3_payload_as_string.png +0 -0
- package/src/blackberry10/index.js +0 -148
- package/src/webworks/build.xml +0 -24
- package/src/webworks/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java +0 -341
- package/src/webworks/src/com/chariotsolutions/nfc/plugin/Util.java +0 -137
- package/src/windows/nfc-plugin.js +0 -285
- package/src/windows-phone-8/Ndef.cs +0 -191
- package/src/windows-phone-8/NfcPlugin.cs +0 -200
- package/tests/package.json +0 -14
- package/tests/plugin.xml +0 -11
- package/tests/tests.js +0 -135
- package/www/nfc-plugin.js +0 -9
- package/www/phonegap-nfc-blackberry.js +0 -76
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,123 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.9.0](https://github.com/EYALIN/community-cordova-plugin-nfc/compare/v1.8.0...v1.9.0) (2026-10-09)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **iOS: `nfc.erase` and `nfc.makeReadOnly`** (PLU-257). Both were Android-only; on iOS 13+, call
|
|
11
|
+
them after `scanNdef`/`scanTag({keepSessionOpen: true})` resolves. `erase` writes an empty NDEF
|
|
12
|
+
record, failing with `READ_ONLY` or `NOT_SUPPORTED` as appropriate; `makeReadOnly` locks the tag
|
|
13
|
+
via `writeLockWithCompletionHandler:`, resolving `{alreadyLocked: true}` if the tag is already
|
|
14
|
+
locked and failing with `NOT_SUPPORTED` if the tag can't be locked. Both accept an optional
|
|
15
|
+
`{alertMessage}` on iOS. Below iOS 13, both fail with `NOT_SUPPORTED`.
|
|
16
|
+
* **iOS: `nfc.transceive` reaches MIFARE tags** (PLU-258), via `NFCMiFareTag.sendMiFareCommand` -
|
|
17
|
+
the response has no `sw1`/`sw2` appended, unlike the existing ISO 7816 path. As an experiment,
|
|
18
|
+
the same MIFARE path is also tried on a tag from an NDEF-session scan when it happens to conform
|
|
19
|
+
to the MIFARE protocol; that fallback is unverified on real hardware.
|
|
20
|
+
* **`nfc.capabilities()`** on every platform: `{erase, makeReadOnly, ntagPassword, platform}`.
|
|
21
|
+
`true`/`true` on Android; on iOS, `erase`/`makeReadOnly` are `true` from 13 onward. `ntagPassword`
|
|
22
|
+
is `true` on Android and **`false` on iOS** even on 13+ - the MIFARE `transceive` path those
|
|
23
|
+
helpers would need (PLU-255/PLU-258) is not yet confirmed against a real NTAG213/215.
|
|
24
|
+
|
|
25
|
+
## [1.8.0](https://github.com/EYALIN/community-cordova-plugin-nfc/compare/v1.7.1...v1.8.0) (2026-09-27)
|
|
26
|
+
|
|
27
|
+
### Fixes
|
|
28
|
+
|
|
29
|
+
* **Android: no more crashes from a stale or pulled tag.** Every background path (`makeReadOnly`, `connect`, `close`, `transceive`, the listener dispatch and the reader-mode callback) now reports an error instead of letting `SecurityException: Tag … is out of date`, `IllegalStateException` or an NPE kill the app.
|
|
30
|
+
* **Android: connections are always closed**, so a write after a failed write or after `makeReadOnly` no longer fails with "Close other technology first!", and `connect()` never silently reuses the previous tag's technology.
|
|
31
|
+
* **Android: errors have a code and a real message.** `transceive` / `connect` failures used to reach JS as `null`; they now say `TAG_LOST`, `IO_ERROR`, `NOT_CONNECTED`, … (see *Errors* in the README).
|
|
32
|
+
* **Android reader mode can write**: `write`, `erase` and `makeReadOnly` work on tags delivered by `readerMode`, and the newest tag always wins.
|
|
33
|
+
* **Android no longer captures every tag while no listener is registered** (behaviour introduced in 1.5.4 without a changelog entry: `enableForegroundDispatch(null, null)`), so a URL tag opens the browser again; deep-link / MAIN launch intents are no longer cleared.
|
|
34
|
+
* **NTAG helpers**: memory maps per IC from `GET_VERSION` (NTAG210/212/213/215/216, Ultralight EV1; NTAG I2C is no longer reported as NTAG216); `readMemoryPages` returns exactly the requested pages (in 1.5.x-1.7.1 every Android dump failed with a `RangeError`); `getPasswordProtectionStatus()` reads the right configuration page and computes write/read protection; `fullMemoryDump` reports read errors instead of relabelling the tag as "MIFARE Ultralight"; `transceive(Uint8Array)` sends only the view's bytes.
|
|
35
|
+
* **iOS: `keepSessionOpen: false` is honoured** (it was read as `true`), callbacks from a cancelled or replaced session can no longer reject the next scan, and a scan started right after `cancelScan` waits for the previous session to end.
|
|
36
|
+
* **iOS errors carry a code** (`200` user cancelled, `201` timeout, … see `nfc.IOS_ERROR`) next to the message.
|
|
37
|
+
* **iOS returns more tag data**: `maxSize` (NDEF capacity), MIFARE family, optional FeliCa polling (`scanTag({pollFeliCa: true})`), and record ids survive writes.
|
|
38
|
+
* **iOS: `NFCReaderUsageDescription` is written on cordova-ios 7 and older again** (1.5.3-1.7.1 only targeted cordova-ios 8's `App/App-Info.plist`).
|
|
39
|
+
* **iOS scan-sheet texts can be localized**: the keys are documented in the README.
|
|
40
|
+
* **Typings match the runtime**: `remove*Listener(callback, …)`, `readerMode`, `FLAG_*`, `isType(record, tnf, type)`, `connect()` result; `ndef.decodeTextRecord` / `decodeUriRecord` now exist.
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
* `nfc.useErrorObjects(true)`: failure callbacks and rejections receive `NfcError {code, message}` objects. Off by default - the message strings are unchanged.
|
|
45
|
+
* Callback APIs (`write`, `erase`, `makeReadOnly`, `enabled`, `showSettings`, the `add*/remove*Listener`s, …) also return a Promise when called without callbacks.
|
|
46
|
+
* NTAG password: `ntagAuthenticate`, `ntagSetPassword`, `ntagRemovePassword` (Android).
|
|
47
|
+
* NXP originality signature: `verifyNtagSignature`, `checkNtagOriginality`.
|
|
48
|
+
* ISO 15693: `nfcvGetSystemInfo`, `nfcvReadBlocks` (Android).
|
|
49
|
+
* MIFARE Classic: `mifareClassicAuthenticate`, `mifareClassicReadBlock`, `mifareClassicInfo` (Android).
|
|
50
|
+
* NFC on/off events: `addStateChangeListener` / `removeStateChangeListener` (Android).
|
|
51
|
+
* `readerMode(flags, onTag, onError, { presenceCheckDelay })` (Android).
|
|
52
|
+
* `showSettings()` opens the NFC settings panel on Android 10+.
|
|
53
|
+
* Background tag reading on Android: plugin variable `NFC_INTENT_FILTERS` (`ndef`, `tech`, `tag`) + `NFC_NDEF_MIME_TYPES`; the tag that launched the app reaches the first matching listener. README section on iOS background reading via Universal Links.
|
|
54
|
+
|
|
55
|
+
### Behaviour changes
|
|
56
|
+
|
|
57
|
+
* Android Beam (`share`, `unshare`, `handover`, `stopHandover`) now fails with `NOT_SUPPORTED`; since 1.4.0 it silently reported success without doing anything (Beam was removed in Android 10).
|
|
58
|
+
* `write`, `erase` and `makeReadOnly` close an open `connect()` session on the same tag first (Android allows one connected technology per tag).
|
|
59
|
+
* Removed the dead `multiCallbackTest` function and the Windows Phone 8, Windows and BlackBerry 10 platforms (and their sources).
|
|
60
|
+
|
|
61
|
+
### Tooling
|
|
62
|
+
|
|
63
|
+
* `npm test`: eslint 9, `tsc` type-test of the typings, Node unit tests (runtime/typings parity, NTAG helpers against a byte-accurate tag model, launch-tag replay, intent-filter hook), a JVM harness for `NfcPlugin.java` (`tests/android/run.sh`) and an iPhoneOS SDK compile of `NfcPlugin.m` (`npm run test:ios`, macOS). GitHub Actions workflow in `.github/workflows/ci.yml`.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## [1.7.1](https://github.com/EYALIN/community-cordova-plugin-nfc/compare/v1.7.0...v1.7.1) (2026-08-13)
|
|
68
|
+
|
|
69
|
+
### Fixes
|
|
70
|
+
|
|
71
|
+
* Android: catch-all error handling in `writeNdefMessage` and `startNfc`, so a stale-tag `SecurityException` or a null `IntentFilter` no longer crashes the app.
|
|
72
|
+
|
|
73
|
+
## [1.7.0](https://github.com/EYALIN/community-cordova-plugin-nfc/compare/v1.6.2...v1.7.0) (2026-05-31)
|
|
74
|
+
|
|
75
|
+
### Features
|
|
76
|
+
|
|
77
|
+
* iOS `nfc.transceive` for ISO 7816 tags (after `scanTag({keepSessionOpen: true})`), resolving with the response data plus SW1/SW2 like Android's IsoDep ([#6](https://github.com/EYALIN/community-cordova-plugin-nfc/issues/6)).
|
|
78
|
+
|
|
79
|
+
## [1.6.2](https://github.com/EYALIN/community-cordova-plugin-nfc/compare/v1.6.1...v1.6.2) (2026-05-25)
|
|
80
|
+
|
|
81
|
+
### Fixes
|
|
82
|
+
|
|
83
|
+
* Removed an invalid `cordova >100` engine constraint from `package.json` ([#11](https://github.com/EYALIN/community-cordova-plugin-nfc/issues/11)).
|
|
84
|
+
|
|
85
|
+
## 1.6.1 (2026-05-23)
|
|
86
|
+
|
|
87
|
+
### Fixes
|
|
88
|
+
|
|
89
|
+
* Restored the `window.nfc`, `window.ndef` and `window.util` legacy globals next to the `NfcPlugin` export ([#11](https://github.com/EYALIN/community-cordova-plugin-nfc/issues/11)).
|
|
90
|
+
|
|
91
|
+
## 1.6.0 (2026-01-23)
|
|
92
|
+
|
|
93
|
+
### Changes
|
|
94
|
+
|
|
95
|
+
* The JS module is exported as `NfcPlugin` (`<clobbers target="NfcPlugin" />`), with `NfcPlugin.NdefPlugin` (ndef helpers) and `NfcPlugin.NfcUtil` (util); typings updated.
|
|
96
|
+
|
|
97
|
+
## 1.5.5 (2026-01-20)
|
|
98
|
+
|
|
99
|
+
### Fixes
|
|
100
|
+
|
|
101
|
+
* iOS: removed the deprecated `NDEF` reader-session format from the entitlements (only `TAG`), fixing App Store validation with the iOS 26.1 SDK.
|
|
102
|
+
|
|
103
|
+
## 1.5.4 (2026-01-20)
|
|
104
|
+
|
|
105
|
+
### Fixes
|
|
106
|
+
|
|
107
|
+
* Android: handle `SecurityException` for stale tag references when writing and in `Util.ndefToJSON`; validate intent filters before `enableForegroundDispatch`.
|
|
108
|
+
|
|
109
|
+
### Behaviour change (not announced at the time)
|
|
110
|
+
|
|
111
|
+
* With no listener registered, foreground dispatch was enabled with `null` filters, so the app captured every tag while in the foreground. Reverted in 1.8.0.
|
|
112
|
+
|
|
113
|
+
## 1.5.3 (2026-01-19)
|
|
114
|
+
|
|
115
|
+
### Changes
|
|
116
|
+
|
|
117
|
+
* iOS: `NFCReaderUsageDescription` was targeted at `App/App-Info.plist` (cordova-ios 8 layout only). Reverted in 1.8.0.
|
|
118
|
+
|
|
119
|
+
## 1.5.2 (2026-01-17)
|
|
120
|
+
|
|
121
|
+
* First npm release of the 1.5 line (the advanced tag analysis methods and typings listed under 1.5.0 below; 1.5.0 and 1.5.1 were not published).
|
|
122
|
+
|
|
6
123
|
## [1.5.0](https://github.com/EYALIN/community-cordova-plugin-nfc/compare/v1.4.0...v1.5.0) (2026-01-17)
|
|
7
124
|
|
|
8
125
|
### Features
|
|
@@ -41,6 +158,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
41
158
|
|
|
42
159
|
---
|
|
43
160
|
|
|
161
|
+
## 1.3.0 (2023-05-29)
|
|
162
|
+
|
|
163
|
+
* First release as `community-cordova-plugin-nfc` (forked from `phonegap-nfc` 1.2.x): package / plugin id, repository and funding links; iOS header import fix.
|
|
164
|
+
|
|
44
165
|
## Previous Versions
|
|
45
166
|
|
|
46
167
|
See the [original phonegap-nfc changelog](https://github.com/chariotsolutions/phonegap-nfc) for earlier version history.
|