Skip to content

[iOS] Switch NSAllowsLocalNetworking to false in production build #898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
danilvalov opened this issue Apr 22, 2025 · 0 comments
Open

Comments

@danilvalov
Copy link

Introduction

As I understand, this option is needed to connect to a local Metro server. But it is not required for production builds. However, it could potentially become a security threat to the application.

Details

I suggest adding an automatic switch for this parameter: NSAllowsLocalNetworking: true only for debug builds, and NSAllowsLocalNetworking: false for production.

Discussion points

Maybe I don't fully understand the architecture of react native, and this parameter is used for some external needs. If so, please write about it.

But if there is any sense in my words, then please write an example of code implementation to add this switch.

@danilvalov danilvalov changed the title [iOS] SwitchNSAllowsLocalNetworking to false in production build [iOS] Switch NSAllowsLocalNetworking to false in production build Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant