react-native-nfc-manager icon indicating copy to clipboard operation
react-native-nfc-manager copied to clipboard

Session sometimes closes itself

Open pke opened this issue 1 month ago • 2 comments

I recon on iOS (Android not tested) an open scan session sometimes closes itself. This means the iOS bottom sheet that displays the alert messages is closed and there is no more active session. Is this a default timeout somewhere (it seems to be around 20 secs)?

The NfcEvents.SessionClosed event listener reports "Unexpected" error.

The phones log reads as follow:

default	02:41:00.789854+0200	app	-[NFCTagReaderSession beginSession]:363
default	02:41:00.790369+0200	nfcd	-[_NFHardwareManager queueReaderSession:sessionConfig:completion:]:4565 app, type:TagReader
default	02:41:00.792910+0200	nfcd	-[_NFHardwareManager regularSessionsAllowed:clientName:]:2426 Checking for _NFReaderSession session for app
default	02:41:00.841800+0200	nfcd	-[_NFReaderSession didStartSession:]:270 app (37785) started _NFReaderSession-736908060.790245 ID:0
default	02:41:00.841976+0200	nfcd	-[_NFReaderSession _sync_startPollingForTags:sessionConfig:completion:]:1244 app (37785) _NFReaderSession-736908060.790245
default	02:41:00.872009+0200	app	NFCTag didBecomeActive
default	02:41:00.920964+0200	app	-[NFCTagReaderSession didDetectTags:connectedTagIndex:]:247 Current connectedTag: None
default	02:41:00.921000+0200	app	-[NFCTagReaderSession didDetectTags:connectedTagIndex:]:251 ConnectedTag[0]: <private>
default	02:41:00.921035+0200	app	NFCTag didDetectTags
error	02:41:01.796395+0200	app	-[NFCTagReaderSession setAlertMessage:]:101 (null)
default	02:41:21.384696+0200	nfcd	-[_NFReaderSession didEndSession:]:248 app (37785) ended _NFReaderSession-736908060.790245
default	02:41:21.385113+0200	app	-[NFCTagReaderSession didTerminate:]:205 sessionState=4, proxy=YES, error=Error Domain=nfcd Code=47 UserInfo={NSLocalizedDescription=<private>}
default	02:41:21.513302+0200	powerd	Process nfcd.60 SessionEnded PreventUserIdleSystemSleep "nfcd[process:app,pid:37785,_NFReaderSession,sessionID:0]" age:00:00:20  id:4295008933 [System: PrevIdle SysAct]

```

pke avatar May 09 '24 00:05 pke