1

Use case: I want a passing by user to Tap his phone on my Kiosk Android Device and get my store's URL opened on his phone's default browser app.

The only option that I could think of the three available (HCE, R/W, P2P) is P2P with Beam. But, the issue, as soon as the user taps the device on my NFC, the whole application shrinks and embeds in a Black UI with a label that says "Touch to Beam". Is there a way I could avoid this 2 step process?

It thought it must be possible because, when we share a URL from chrome app using Beam, it just opens in the other device not asking to "Touch to Beam". But I could not find any answer that supports it.

fun send(activity: Activity, url: String, callback: (Boolean)->Unit){
    mCallback = callback
    mNfcAdapter?.setOnNdefPushCompleteCallback(this, activity)
    mNfcAdapter?.setNdefPushMessage( NdefMessage(NdefRecord.createUri(Uri.encode(url))), activity)
}

 override fun onNdefPushComplete(event: NfcEvent?) {
    mCallback?.invoke(true)
}
Bavan
  • 1,021
  • 1
  • 10
  • 24
  • I don't know the details of how this works with a active NFC endpoint (your kiosk). If this were an NFC tag, you would simply have an NDEF record on the tag that had the URL. – CommonsWare Nov 13 '18 at 00:07
  • That means, Kisok should act as a NFC Tag. However, based on the answer from https://stackoverflow.com/questions/23155719/host-card-emulation-on-android-4-4-kitkat-and-above-with-nexus-5 it seems not possible without a specific reader application. – Bavan Nov 13 '18 at 00:35

0 Answers0