Closed friode closed 10 years ago
Not possible. The Android framework needs to know where to send the NFC event. If the mimetype is not available, another app will get the scan and the device will not unlock.
You can't register to handle NDEF_DISCOVERED and read the individual NdefRecords in the NdefMessage to see if there's a match?
https://developer.android.com/guide/topics/connectivity/nfc/nfc.html#dispatching https://developer.android.com/reference/android/nfc/NdefMessage.html
Weve had a bit of an internal discussion on this and have come to the conclusion that, while possible, there is not really a practical way to do this.
On Wed, Apr 30, 2014 at 5:21 PM, friode notifications@github.com wrote:
You can't register to handle NDEF_DISCOVERED and read the individual NdefRecords in the NdefMessage to see if there's a match?
https://developer.android.com/guide/topics/connectivity/nfc/nfc.html#dispatching https://developer.android.com/reference/android/nfc/NdefMessage.html
— Reply to this email directly or view it on GitHubhttps://github.com/mclear/Android_NFC_Ring_Unlock/issues/54#issuecomment-41852376 .
Fair enough, this does reduce the utility of the ring somewhat, though. There's no way for me to use one ring to 1) unlock my phone, 2) unlock my front door, and 3) have a url or contact information available. And if I use the second inlay on a ring as a backup of the first, it limits it to only a single function.
Sure you can do all three just not a backup....
----- Reply message ----- From: "friode" notifications@github.com To: "mclear/Android_NFC_Ring_Unlock" Android_NFC_Ring_Unlock@noreply.github.com Subject: [Android_NFC_Ring_Unlock] Add support for multiple NDEF records (#54) Date: Wed, Apr 30, 2014 14:50
Fair enough, this does reduce the utility of the ring somewhat, though. There's no way for me to use one ring to 1) unlock my phone, 2) unlock my front door, and 3) have a url or contact information available. And if I use the second inlay on a ring as a backup of the first, it limits it to only a single function.
— Reply to this email directly or view it on GitHubhttps://github.com/mclear/Android_NFC_Ring_Unlock/issues/54#issuecomment-41855617.
Sorry if I'm missing something obvious, but could you describe that scenario in a little more detail?
I'd like to be able to unlock my phone with an inlay that has multiple NDEF records, where the nfcringunlock/key MIME record is not the first record.
The first record is often used as the default by apps that don't support multiple NDEF records, and I'd like to use that record for a more sensible default (e.g. contact information or URL), whilst retaining the ability to unlock the phone with the same inlay.
Tested with http://ndefeditor.grundid.de/ and https://play.google.com/store/apps/details?id=com.antares.nfc