Notifee’s documentation states that a maximum of 50 background trigger notifications can be created for Android. In my testing, I have found that this is the case for 2 of my Android test devices, but when testing with a Samsung Galaxy Tab A7 (SM-T500), running Android 11, when I queue 50 triggers, only 26 of them play, then they stop. My Moto X4 (Android 9) and Samsung SM-J327 (Android 7) work as described (50 can be queued and work correctly). And all my iOS devices can play 64 notifications as documented.
I have tried with and without alarm manager:
const trigger: TimestampTrigger = {
type: TriggerType.TIMESTAMP,
timestamp: interval.time,
alarmManager: true,
};
I also tried with alarmManager set to {allowWhileIdle: true}
. And when I put my app in the background to test, I switch to another app that stays in the foreground so the tablet does not go to sleep.
I wondered if there was a time limit, but it doesn’t seem to matter if the 26 notifications are scheduled one per minute, or they are spread out over 2-3 hours.
When I create the notifications, I want add a special message to the last one (50th or 64th) to warn the user that we’re “out of notifications”, and recommend if she wants to continue hearing them in the background, she should open my app. But if this number varies from device to device, it will be impossible to do this correctly.
Is there something wrong with my Tab or is this variation to be expected?
@notifee/react-native Version 7.8.2
info Fetching system and libraries information...
System:
OS: macOS 14.3.1
CPU: (8) arm64 Apple M1 Pro
Memory: 103.34 MB / 16.00 GB
Shell:
version: 3.2.57
path: /bin/bash
Binaries:
Node:
version: 20.11.1
path: ~/.nodenv/versions/20.11.1/bin/node
Yarn:
version: 1.22.19
path: /opt/homebrew/bin/yarn
npm:
version: 10.2.4
path: ~/.nodenv/versions/20.11.1/bin/npm
Watchman:
version: 2024.05.06.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.12.1
path: /Users/chet/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- visionOS 1.0
- watchOS 10.2
Android SDK:
API Levels:
- "23"
- "24"
- "28"
- "30"
- "31"
- "33"
- "33"
- "34"
Build Tools:
- 28.0.3
- 30.0.2
- 30.0.3
- 31.0.0
- 33.0.0
- 33.0.2
- 33.0.3
- 34.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 NDK: Not Found
IDEs:
Android Studio: 2023.2 AI-232.10300.40.2321.11567975
Xcode:
version: 15.2/15C500b
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.18
path: /usr/bin/javac
Ruby:
version: 2.7.7
path: /Users/chet/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.12
wanted: ^0.72.12
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false