Skip to content
This repository was archived by the owner on Nov 26, 2020. It is now read-only.

Unmounting nfc listeners? #8

Open
smitch88 opened this issue Jul 5, 2017 · 4 comments
Open

Unmounting nfc listeners? #8

smitch88 opened this issue Jul 5, 2017 · 4 comments

Comments

@smitch88
Copy link

smitch88 commented Jul 5, 2017

I initialize some of the listeners usingaddListener in componentDidMount of a particular screen container. This particular app does a loop to process multiple tags. However, I don't want a user to be able to read NFC for the app at any random screen in the process. Is there already a way to remove the binding that was added, perhaps calling something on componentWillUnmount?

Would you suggest an alternative is just starting the listener once on app load and checking for the particular screen is the that is in view?

@giordy
Copy link
Member

giordy commented Jul 6, 2017

The "removeListener" is not implemented yet (it's a trivial addition though).

What you suggest is a possible workaround for the moment.

@smitch88
Copy link
Author

smitch88 commented Jul 6, 2017

Is there a plan to do this soon or would you like me to attempt to put a PR in?

@henrikra
Copy link

@smitch88 I think doing PR would be easy enough for you to do ;)

@clickclickonsal
Copy link

@henrikra I submitted a pull request with being able to remove the NFC Listener. 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants