Releases: zoontek/react-native-permissions
4.0.0
Version 4.0.0, with iOS 17 and Android 14 support 🎉
What's changed
- Deprecated iOS permission setup methods have been removed.
setup_permissions
is now the unique way to do it openLimitedPhotoLibraryPicker
has been renamedopenPhotoPicker
PERMISSIONS.IOS.BLUETOOTH_PERIPHERAL
has been renamedPERMISSIONS.IOS.BLUETOOTH
What's new
- New Android permission:
PERMISSIONS.ANDROID.READ_MEDIA_VISUAL_USER_SELECTED
(closes #827) - New iOS permission:
PERMISSIONS.IOS.CALENDARS_WRITE_ONLY
(closes #804) openPhotoPicker
now resolves on picker close, not immediately (closes #689)PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY
now resolves therequestTrackingAuthorizationWithCompletionHandler
callback value (closes #823)
How to migrate
- Migrate to the
setup_permissions
method - Replace
PERMISSIONS.IOS.BLUETOOTH_PERIPHERAL
withPERMISSIONS.IOS.BLUETOOTH
- Replace
BluetoothPeripheral
withBluetooth
insetup_permissions
- Replace
NSCalendarsUsageDescription
withNSCalendarsFullAccessUsageDescription
- Replace
NSRemindersUsageDescription
withNSRemindersFullAccessUsageDescription
- Replace
openLimitedPhotoLibraryPicker
withopenPhotoPicker
What's next?
This release is quite minimal. If your company wants a new feature, feels free to reach me via email to hire me for it 🙂
3.10.1
3.10.0
3.9.3
3.9.2
3.9.1
3.9.0
Run 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
setup_permissions([
# 'AppTrackingTransparency',
# 'BluetoothPeripheral',
# 'Calendars',
# 'Camera',
# 'Contacts',
# 'FaceID',
# 'LocationAccuracy',
# 'LocationAlways',
# 'LocationWhenInUse',
# 'MediaLibrary',
# 'Microphone',
# 'Motion',
# 'Notifications',
# 'PhotoLibrary',
# 'PhotoLibraryAddOnly',
# 'Reminders',
# 'Siri',
# '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>
asrationale
argument.
This way, you can display custom rationale alerts instead of the native ones (fixes #710)
3.8.4
3.8.3
- Use gradle
namespace
conditionally in order to improve old react native version compatibility.
⚠️ Note that this library officially now follows the React Native releases support policy. If you have been impacted by this bug, that means you are using an unsupported react native version and should upgrade to the latest.