Hi,
I am integrating the HCE-based API into our SDK.
Ideal flow
It is bit tricky to support card change (step 3 below) after field-detect/double click due to NFC action sheet. Ideally, the flow is:
- User double-click.
- App launch
- "Hold near Reader" NFC instruction
- (optional) User change card
- User tap device to POS reader
- payment succeed.
Approach A
If I follow the code snippet in CardSession, where it calls startEmulation
after readerDetected
, I could change card before that. However, the "Hold near Reader" NFC instruction is shown very late, during tap.
- User double-click
- App launch
- (optional)User change card
- User tap device to POS reader
- "Hold near Reader" NFC instruction
- payment succeed.
Approach B
If I call startEmulation
after sessionStarted
, I could show "Hold near Reader" NFC. However, I could not provide the optional capability to change card anymore.
- User double-click
- App launch
- "Hold near Reader" NFC instruction
- User tap device to POS reader
- payment succeed.
Neither approach A or B provide optimal approach shown in Ideal flow.
Is this expected from CardSession
that there is no option to startEmulation
without the action sheet?
Is there a plan to improve startEmulation
so that it could show "Hold near Reader" without the action sheet?
Thank you.
The modal action sheet is part of calling startEmulation
. This is also indicated in the documentation:
startEmulation()
Start the card emulation and present a modal user interface to the person using the app.
and currently there is no option to turn this off. If you would like for Apple to consider adding support for such a feature, please submit your suggestion request via Feedback Assistant (https://feedbackassistant.apple.com)