fix(ios): only append ISO18092 polling flag when felica is added into

scanning techs

- so we don't need to force the user to setup
  "com.apple.developer.nfc.readersession.felica.systemcodes"
This commit is contained in:
Richie 2022-06-25 17:21:39 +08:00
parent 5aef17bcd6
commit c9b9013c6d

View File

@ -286,8 +286,12 @@ RCT_EXPORT_METHOD(requestTechnology: (NSArray *)techs options: (NSDictionary *)o
{
if (@available(iOS 13.0, *)) {
if (tagSession == nil && session == nil) {
NFCPollingOption pollFlags = NFCPollingISO14443 | NFCPollingISO15693;
if ([techs containsObject:@"felica"]) {
pollFlags |= NFCPollingISO18092;
}
tagSession = [[NFCTagReaderSession alloc]
initWithPollingOption:(NFCPollingISO14443 | NFCPollingISO15693 | NFCPollingISO18092) delegate:self queue:dispatch_get_main_queue()];
initWithPollingOption:pollFlags delegate:self queue:dispatch_get_main_queue()];
tagSession.alertMessage = [options objectForKey:@"alertMessage"];
[tagSession beginSession];
techRequestTypes = techs;