-
-
Notifications
You must be signed in to change notification settings - Fork 847
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Before submitting a new issue
- I tested using the latest version of the library, as the bug might be already fixed.
- I tested using a supported version of react native.
- I checked for possible duplicate issues, with possible answers.
Bug summary
Apologies if I am missing something obvious.
The README lists POST_NOTIFICATIONS as a supported permission in android:
<!-- /AndroidManifest.xml -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
And import {PERMISSIONS} from 'react-native-permissions'; lists:
PERMISSIONS.ANDROID.POST_NOTIFICATIONS;
However, if I try to import PERMISSIONS and use PERMISSIONS.ANDROID.POST_NOTIFICATIONS; I get the following error:
Property 'POST_NOTIFICATIONS' does not exist on type 'Readonly<{ readonly ACCEPT_HANDOVER: "android.permission.ACCEPT_HANDOVER"; readonly ACCESS_BACKGROUND_LOCATION: "android.permission.ACCESS_BACKGROUND_LOCATION"; readonly ACCESS_COARSE_LOCATION: "android.permission.ACCESS_COARSE_LOCATION"; ... 36 more ...; readonly WRITE_EXTERNAL_STORAGE: "android.permission.WRITE_EX...'
And indeed I cannot see it listed in src/permissions.android.ts
Library version
5.4.1
Environment info
System:
OS: macOS 15.4.1
CPU: (8) arm64 Apple M2
Memory: 140.64 MB / 24.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.20.0
path: ~/.nvm/versions/node/v18.20.0/bin/node
Yarn:
version: 4.9.1
path: ~/.nvm/versions/node/v18.20.0/bin/yarn
npm:
version: 10.5.0
path: ~/.nvm/versions/node/v18.20.0/bin/npm
Watchman:
version: 2025.05.26.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /Users/gaia/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.2
- iOS 18.2
- macOS 15.2
- tvOS 18.2
- visionOS 2.2
- watchOS 11.2
Android SDK:
API Levels:
- "31"
- "33"
- "34"
- "35"
Build Tools:
- 30.0.3
- 31.0.0
- 33.0.0
- 34.0.0
- 35.0.0
System Images:
- android-31 | Google APIs ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
- android-35 | Google APIs ARM 64 v8a
- android-35 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2024.3 AI-243.25659.59.2432.13423653
Xcode:
version: 16.2/16C5032a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.15
path: /usr/bin/javac
Ruby:
version: 3.3.4
path: /Users/gaia/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: trueSteps to reproduce
Import PERMISSIONS from 'react-native-permissions' and try to use PERMISSIONS.ANDROID.POST_NOTIFICATIONS
Reproducible sample code
import { PERMISSIONS, request } from 'react-native-permissions';
request(PERMISSIONS.ANDROID.POST_NOTIFICATIONS)Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working