首页 > 解决方案 > react-native-permissions 和 expo-permissions 之间是否有任何权衡?

问题描述

我正在尝试为我的项目在 react-native-permissions 或 expo-permissions 之间进行选择。它们都适用于 iOS 和 Android,但 expo-permissions 代码更简洁。除此之外,我应该注意两者之间的权衡吗?

我正在使用没有 Expo 的裸反应原生工作流程。

标签: react-nativereact-native-permissionsexpo-permissions

解决方案


如果您使用的是裸 react-native 工作流,则应使用 react-native-permissions,因为 expo-permissions 仅适用于 expo 托管工作流。

虽然 Expo 有react-native-unimodules包,可以给你权限模块。

如果您阅读了有关expo-permissions的文档,您可以在安装指南中看到这个东西。谢谢


推荐阅读