appidea / react-native-hce

Emulate smart cards inside React-Native application.
MIT License
67 stars 26 forks source link

listen() function isseus #20

Closed SurpriseMF3000 closed 1 year ago

SurpriseMF3000 commented 1 year ago

Hello again;) im facing issues with the listen() function. If im calling the listen() function in the startsession() function, the phone recognizes when there is an actual data transfer and everything works the first time great. But when im calling the startsession() function a second time, the listen() output from the first time gets printed and fucks everything up.

Is there any way to avoid this?

Thanks for Help!

SurpriseMF3000 commented 1 year ago

I figured out that the only way to avoid this is to set session.on = null; after a full cycle before the next one.

Are there any other ways?

appidea commented 1 year ago

Did You try to cleanup previous event listeners before creating the new session? To do that, call the function that comes as a result of on(...) method.

appidea commented 1 year ago

no response, closing...