React Native Permissions checks and requests device permissions on iOS, Android, and Windows. On iOS, apps must describe why they use each permission, and reviewers may reject an app if its code can request permissions that the app does not need. Some users responded by maintaining forks with unwanted permission code removed.
Adding modularity to your React Native library
Speaker
Mathieu Acthernoene, main maintainer of React Native Permissions and an engineer at Swan, explains how he made the library’s permission code modular at React Native EU 2023.
With React Native 0.60 and CocoaPods integration, Acthernoene first explored using subspecs to link only the needed permission files. Autolinking made that approach impractical, so the team tried separate pods for each permission, with a shared core exposing `check` and `request` methods. Xcode caching sometimes kept newly added permissions from being detected, while framework builds hid the files the core needed to inspect.
The separate pod approach created a difficult developer experience. The team built a React Native CLI plugin that changed the podspec to include selected permission files, but users had to rerun it after deleting `node_modules`, and package hoisting caused problems in monorepos.
To address those issues, Acthernoene rewrote the setup script in Ruby so CocoaPods could run it before installation. Developers load the script in the Podfile and call `setup_permissions`, which updates the library specs based on the chosen permissions. This removed the need to rerun the setup after deleting `node_modules` and fixed the hoisting issue.
Acthernoene says software that combines technologies and platforms may take several attempts to get right. He encourages users to be empathetic toward open source maintainers and contribute where they can, including documentation and issue follow-up.
Takeaways
- Make optional platform features explicit so apps only include the code they need.
- Check how build caching and framework packaging affect any file-based detection approach.
- Put setup logic in the toolchain that can run it reliably, including after dependency changes.
- Treat open source maintenance as human work, and contribute small fixes or documentation when possible.
Mentioned in this talk
Search inside this talk
What was claimed 10
- featureSwan: Provides a GraphQL API as a service for banking services
“We provide a GraphQL API as a service for banking services”
YouTube Unverified1 source· Talk
- works atMathieu Acthernoene works at Swan
“I work at a company called Swan”
YouTube Unverified1 source· Talk
- role atMathieu Acthernoene is podcast host at Put on the Code
“I'm also a podcast host at Put on the Code”
YouTube Unverified1 source· Talk
- role atMathieu Acthernoene is main maintainer at React Native Permissions
“I'm the main maintainer of React Native Permissions”
YouTube Unverified1 source· Talk
- builtYona built React Native Permissions
“In 2016, Yona created this library”
YouTube Unverified1 source· Talk
- featureReact Native Permissions: Checks and requests device permission statuses from React Native code
“it allows you to check and request permission statuses directly from your React Native code”
YouTube Unverified1 source· Talk
- integrates withReact Native Permissions integrates with
Pods“Fully embracing CocoaPods allowed us to solve our issue”
YouTube Unverified1 source· Talk
- usesconfiguration plugin
“Introducing the React Native CLI plugin”
YouTube Unverified1 source· Talk






