Flutter plugin for accessing the Japanese Mynumber features on Android and iOS.
Android Setup
- Add android.permission.NFC to your
AndroidMenifest.xml
.
iOS Setup
-
Add Near Field Communication Tag Reader Session Formats Entitlements to your entitlements.
-
Add NFCReaderUsageDescription to your
Info.plist
. -
Add com.apple.developer.nfc.readersession.iso7816.select-identifiers to your
Info.plist
. -
Add the following 4 items to com.apple.developer.nfc.readersession.iso7816.select-identifiers
D392F000260100000001
D3921000310001010408
D3921000310001010100
D3921000310001010401
import 'package:flutter_nfc_mynumber/flutter_nfc_mynumber.dart';
import 'package:flutter_nfc_mynumber/mynumber_util.dart';
var nfcAvailability = await FlutterNfcMynumber.nfcAvailability;
if (availability != NFCAvailability.available) {
// oh-no
}
try{
await FlutterNfcMynumber.startSession();
await FlutterNfcMynumber.setIosAlertMessage("connecting...");
// get retry count
await MynumberUtil.getAuthPinRetryCount();
await MynumberUtil.getSigningPinRetryCount();
// get signature value
await MynumberUtil.getSignatureByAuthPassword("password", "digestValue");
await MynumberUtil.getSignatureBySigningPassword("password", "digestValue");
// send original APDU command.
await FlutterNfcMynumber.transceive(Uint8List.fromList([0x00, 0xB0, 0x00, 0x00, 0x04]))
} catch (e) {}
await FlutterNfcMynumber.finishSession();
A more complicated example can be seen in example dir.