Reputation: 2730
I have an app that has the possibility to log in using a Mifare classic 1K nfc chip. Our customers use another app (nedap) that has the same functionality, but with a different card (same type though). If both apps are open and my app is in the foreground they can log in using our nfc tag. However, when the other app is in the foreground and they try to log in using the other nfc chip, that app refuses to log in (it's just stuck in the login screen without error). If only one app is open there are no problems at all.
Is this my fault or is it an error in the other app? If it is my fault, how can I make sure I don't screw with other apps when implementing nfc functionality?
Upvotes: 1
Views: 522
Reputation: 332
If an app is launched using the foreground dispatch system, only this app handles the NFC traffic:
The foreground dispatch system allows an activity to intercept an intent and claim priority over other activities that handle the same intent.
When your app goes into background you have to disable it:
Also, activities must call
disableForegroundDispatch(Activity)
before the completion of theironPause()
callback to disable foreground dispatch after it has been enabled.
Upvotes: 1