Capacitor
Integration time — 8 minutes.

Requirements

iOS

iOS 13+ (CoreNFC is required), Xcode 12.5.1+ SDK can be imported to a project with target version iOS 11, but it will be able to work only from iOS 13.

Android

Android with minimal SDK version of 21 and a device with NFC support.

Installation

To install this plugin to you project run next comman line commands:
1
npm install tangem-sdk
2
npx cap sync
Copied!
Cordova platform should do all the configurations by itself.
Configure your app to detect NFC tags. Turn on Near Field Communication Tag Reading under the Capabilities tab for the project’s target (see Add a capability to a target).
When you adding Near Field Communication Tag Reading capability, Xcode generates entries in *.entitlement file. You should check that there are only the Tag string in com.apple.developer.nfc.readersession.formats array. Otherwise AppStore will reject your build when you try to upload it.
1
<key>com.apple.developer.nfc.readersession.formats</key>
2
<array>
3
<string>TAG</string>
4
</array>
Copied!
Add the NFCReaderUsageDescription key as a string item to the Info.plist file. For the value, enter a string that describes the reason the app needs access to the device’s NFC reader:
1
<key>NFCReaderUsageDescription</key>
2
<string>To scan NFC smart cards</string>
Copied!
In the Info.plist file, add the list of the application identifiers supported in your app to the ISO7816 Select Identifiers (AIDs) information property list key. The AIDs of Tangem cards are: A000000812010208 and D2760000850101.
1
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
2
<array>
3
<string>A000000812010208</string>
4
<string>D2760000850101</string>
5
</array>
Copied!
Optional: To prevent customers from installing apps on a device that does not support the NFC capability, add the following to the Info.plist code:
1
<key>UIRequiredDeviceCapabilities</key>
2
<array>
3
<string>nfc</string>
4
</array>
Copied!
Last modified 7mo ago