react-native-permissions

An unified permissions API for React Native on iOS, Android and Windows.

MIT License

Downloads
2M
Stars
4K
Committers
109

Bot releases are visible (Hide)

react-native-permissions - 4.1.5 Latest Release

Published by zoontek 7 months ago

react-native-permissions - 4.1.4

Published by zoontek 8 months ago

react-native-permissions - 4.1.3

Published by zoontek 8 months ago

react-native-permissions - 4.1.2

Published by zoontek 8 months ago

react-native-permissions - 4.1.1

Published by zoontek 9 months ago

  • Fix Expo plugin not working on Expo SDK 50 (closes #840)
react-native-permissions - 4.1.0

Published by zoontek 9 months ago

react-native-permissions - 4.0.4

Published by zoontek 10 months ago

  • Fix a regression caused by the example app (now using yarn link) that updated the project podspec
react-native-permissions - 4.0.3

Published by zoontek 10 months ago

  • Add Android Gradle plugin 8 compatibility
  • Fix AndroidManifest.xml namespace deprecation warning
react-native-permissions - 4.0.2

Published by zoontek 10 months ago

react-native-permissions - 4.0.1

Published by zoontek 10 months ago

  • Enforce checkNotifications behaviour on Android < 13 to match the Android runtime permissions flow and all others permissions behaviour (for more details, I made a post here).
  • Update example app to React Native 0.73.0
react-native-permissions - 4.0.0

Published by zoontek 11 months ago

Version 4.0.0, with iOS 17 and Android 14 support 🎉

⚠️ This version requires Xcode 15 and drops support for iOS < 12.4 and React Native < 0.70.

What's changed

  • Deprecated iOS permission setup methods have been removed. setup_permissions is now the unique way to do it
  • openLimitedPhotoLibraryPicker has been renamed openPhotoPicker
  • PERMISSIONS.IOS.BLUETOOTH_PERIPHERAL has been renamed PERMISSIONS.IOS.BLUETOOTH

What's new

How to migrate

  • Migrate to the setup_permissions method
  • Replace PERMISSIONS.IOS.BLUETOOTH_PERIPHERAL with PERMISSIONS.IOS.BLUETOOTH
  • Replace BluetoothPeripheral with Bluetooth in setup_permissions
  • Replace NSCalendarsUsageDescription with NSCalendarsFullAccessUsageDescription
  • Replace NSRemindersUsageDescription with NSRemindersFullAccessUsageDescription
  • Replace openLimitedPhotoLibraryPicker with openPhotoPicker

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 🙂

react-native-permissions - 3.10.1

Published by zoontek 12 months ago

  • Catch NullPointerException in onRequestPermissionsResult (fix #820)
react-native-permissions - 3.10.0

Published by zoontek about 1 year ago

react-native-permissions - 3.9.3

Published by zoontek about 1 year ago

react-native-permissions - 3.9.2

Published by zoontek about 1 year ago

  • Remove the necessity to declare NSLocationAlwaysUsageDescription as it's deprecated in iOS 17 (fixes #806)
  • Replace missing usage description error logbox with a warning one
react-native-permissions - 3.9.1

Published by zoontek about 1 year ago

  • Fix silent fail onRequestPermissionsResult for invalid activities (#805 by @webraptor)
react-native-permissions - 3.9.0

Published by zoontek about 1 year ago

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 (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.


react-native-permissions - 3.8.4

Published by zoontek over 1 year ago

  • Only supports iOS 12.4+ with new architecture to prevent compilation issues (#786 by @hsjoberg)
react-native-permissions - 3.8.3

Published by zoontek over 1 year ago

  • 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.
react-native-permissions - 3.8.2

Published by zoontek over 1 year ago

  • Update Support mention
Package Rankings
Top 0.77% on Npmjs.org
Badges
Extracted from project README
mit licence npm version npm downloads platform - android platform - ios platform - windows
Related Projects