title: Emulating NDEF NFC Tag on Android phone -> Reading with iPhone/iOS core-nfc
body: <p>I use a <code>HostApduService</code> on Android(7) to emulate an NFC forum type 4 (<code>NDEF</code>) tag.</p>
  
  <p>Reading the <code>NDEF</code> text message works reliably from android, I ran into the following issues though:</p>
  
  <ul>
  <li>When I scan the emulating phone with NXP TagInfo from another Android device, Google Play opens up since it is also listening, but the <code>NDEF</code> tag always gets scanned successfully.</li>
  <li>Reading the Tag using NXP TagInfo on an iPhone(7) as a reader is different: The core <code>NFC</code> API looks very limited, and scanning has to be initiated by the user, accompanied by a "ready to scan" dialog. When I hold the iPhone to the Android Device, sometimes the dialog closes with the message "<code>NFC</code> session expired" (about 50% of the tries). When I lock the emulating Android phone, the <code>NDEF</code> service still runs, and the iPhone can scan the Tag with a 100% success rate.</li>
  </ul>
  
  <p>I think I already fixed the first issue using <code>ForegroundDispatch</code> (the Tag Emulation is only needed when the Emulating app is shown on the screen). However, the iPhone still cancels scanning sometimes. I suppose this could also be caused by the Android phone trying to connect to the iPhone's HCE/ApplePay/whatever is there.</p>
  
  <p>So I believe the cause of my problem is Android scanning for all kinds of tags while <code>NFC</code> is enabled.</p>
  
  <p>Is there a way to disable actively scanning for passive tags from an app, while still running the <code>HostApduService</code> that emulates an <code>NFC</code> tag?</p>
  
  <p>(I will update this question as soon as I get the core <code>NFC</code> error messages.)</p>