An unified permissions API for React Native on iOS, Android and Windows.
MIT License
Bot releases are hidden (Show)
Microsoft.Windows.CppWinRT
version provided by RNW by @tido64 in https://github.com/zoontek/react-native-permissions/pull/860
UserDefaults
by @johnhatvani in https://github.com/zoontek/react-native-permissions/pull/861
Published by zoontek 8 months ago
Published by zoontek 8 months ago
Published by zoontek 8 months ago
Published by zoontek 9 months ago
Published by zoontek 9 months ago
Attempt to invoke interface method 'void com.facebook.react.bridge.Callback.invoke(java.lang.Object[])'
by @webraptor in https://github.com/zoontek/react-native-permissions/pull/835
Published by zoontek 10 months ago
yarn link
) that updated the project podspec
Published by zoontek 10 months ago
AndroidManifest.xml
namespace deprecation warningPublished by zoontek 10 months ago
PERMISSIONS.IOS.MEDIA_LIBRARY
permission request on the iOS simulator (https://github.com/zoontek/react-native-permissions/pull/831 by @asafkorem)Published by zoontek 11 months ago
⚠️ This version requires Xcode 15 and drops support for iOS < 12.4 and React Native < 0.70.
setup_permissions
is now the unique way to do itopenLimitedPhotoLibraryPicker
has been renamed openPhotoPicker
PERMISSIONS.IOS.BLUETOOTH_PERIPHERAL
has been renamed PERMISSIONS.IOS.BLUETOOTH
PERMISSIONS.ANDROID.READ_MEDIA_VISUAL_USER_SELECTED
(closes https://github.com/zoontek/react-native-permissions/issues/827)PERMISSIONS.IOS.CALENDARS_WRITE_ONLY
(closes https://github.com/zoontek/react-native-permissions/issues/804)openPhotoPicker
now resolves on picker close, not immediately (closes https://github.com/zoontek/react-native-permissions/issues/689)PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY
now resolves the requestTrackingAuthorizationWithCompletionHandler
callback value (closes https://github.com/zoontek/react-native-permissions/issues/823)setup_permissions
methodPERMISSIONS.IOS.BLUETOOTH_PERIPHERAL
with PERMISSIONS.IOS.BLUETOOTH
BluetoothPeripheral
with Bluetooth
in setup_permissions
NSCalendarsUsageDescription
with NSCalendarsFullAccessUsageDescription
NSRemindersUsageDescription
with NSRemindersFullAccessUsageDescription
openLimitedPhotoLibraryPicker
with openPhotoPicker
This release is quite minimal. If your company wants a new feature, feels free to reach me via email to hire me for it 🙂
Published by zoontek 12 months ago
NullPointerException
in onRequestPermissionsResult
(fix #820)Published by zoontek about 1 year ago
[CLLocationManager locationServicesEnabled]
check. It's not needed, if Location services are disabled, iOS will return BLOCKED
(+ it matches Android behaviour)Published by zoontek about 1 year ago
[CLLocationManager locationServicesEnabled]
in an async way to prevent UI freezes when checking / requesting location permissions on iOS (https://github.com/zoontek/react-native-permissions/commit/82e178fe65583e635e08075ca63a4d120934f54a)Published by zoontek about 1 year ago
NSLocationAlwaysUsageDescription
as it's deprecated in iOS 17 (fixes #806)Published by zoontek about 1 year ago
onRequestPermissionsResult
for invalid activities (#805 by @webraptor)Published by zoontek about 1 year ago
setup_permissions
directly in your Podfile
This release come with an alternative permission linkage system for iOS: calling a function, setup_permissions
inside your Podfile
.
It offers the same benefits as the react-native setup-ios-permissions
command (and actually perform the exact same operation), but it lives in your Podfile
, so there's no need to run it each time your delete your node_modules
directory.
The only requirement is to run pod install
when your update your Podfile
, which make much more sense 😄
This method also solves issues with monorepos / dependencies hoisting.
To migrate, remove your reactNativePermissionsIOS
config, and update your Podfile
:
# with react-native >= 0.72
- # Resolve react_native_pods.rb with node to allow for hoisting
- require Pod::Executable.execute_command('node', ['-p',
- 'require.resolve(
- "react-native/scripts/react_native_pods.rb",
- {paths: [process.argv[1]]},
- )', __dir__]).strip
+ def node_require(script)
+ # Resolve script with node to allow for hoisting
+ require Pod::Executable.execute_command('node', ['-p',
+ "require.resolve(
+ '#{script}',
+ {paths: [process.argv[1]]},
+ )", __dir__]).strip
+ end
+ node_require('react-native/scripts/react_native_pods.rb')
+ node_require('react-native-permissions/scripts/setup.rb')
# with react-native < 0.72
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
+ require_relative '../node_modules/react-native-permissions/scripts/setup'
Then in the same file, call setup_permissions
with the wanted permissions:
# …
platform :ios, min_ios_version_supported
prepare_react_native_project!
# ⬇️ uncomment wanted permissions (don't forget to remove the last comma)
setup_permissions([
# 'AppTrackingTransparency',
# 'BluetoothPeripheral',
# 'Calendars',
# 'Camera',
# 'Contacts',
# 'FaceID',
# 'LocationAccuracy',
# 'LocationAlways',
# 'LocationWhenInUse',
# 'MediaLibrary',
# 'Microphone',
# 'Motion',
# 'Notifications',
# 'PhotoLibrary',
# 'PhotoLibraryAddOnly',
# 'Reminders',
# 'SpeechRecognition',
# 'StoreKit'
])
# …
And run pod install
. Done! ✨
📌 The React Native CLI plugin still exists and will not be removed until next major version.
request
now accepts () => Promise<boolean>
as rationale
argument.This way, you can display custom rationale alerts instead of the native ones (fixes https://github.com/zoontek/react-native-permissions/issues/710)Published by zoontek over 1 year ago
Published by zoontek over 1 year ago
namespace
conditionally in order to improve old react native version compatibility.Published by zoontek over 1 year ago