为什么安卓NFC可以读取一些非接触式emv信用卡,而不能读取其他信用卡



我已经看了这个问题:在安卓上通过NFC读取Visa payWave信用卡详细信息

我已经开始编写一个应用程序,可以读取我的Visa非接触式卡,但当我点击Visa非接触借记卡时,我什么也得不到,甚至连nfc卡检测到的提示都没有。这是我设置nfc适配器的代码,以便它可以读取非接触式卡:

val tagFilters = arrayOf(discoveryTag, discoveryTech)
adapter.enableReaderMode(this, this, NfcAdapter.FLAG_READER_NFC_A or NfcAdapter.FLAG_READER_NFC_B, null)
adapter.enableForegroundDispatch(this, pi, tagFilters, null)

以及当我点击非接触式EMV卡时激发的意图:

override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
// gets a tag object
val tagFromIntent = intent?.getParcelableExtra<Tag>(NfcAdapter.EXTRA_TAG)
Log.i("NFC_TEST", tagFromIntent.toString())
// it is better to iterate through the tech list and make sure it is what we want
// tagFromIntent?.techList!![0]
// get an instance of the IsoDep
val isoDep = IsoDep.get(tagFromIntent)
if(isoDep == null) {
Log.i("NFC_TEST", "Failed to read card")
return
}
}

Visa非接触式和Visa借记非接触式的AID有什么不同吗?但我还是应该对非接触式卡进行一些检测。

我不想使用三角形或正方形的设备,所以请不要建议使用这些设备。我真的很想在手机上使用非接触式点击功能。

我正在使用谷歌Nexus 4进行测试。

检查您试图读取的卡上是否有非接触式标志。现在仍然有很多只使用芯片和刷卡的支付卡。即根本没有非接触式接口。

最新更新