react-native-notify-kit 10.8.1 → 10.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -18
- package/android/build.gradle +50 -4
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/app/notifee/core/ForegroundService.java +395 -5
- package/android/src/main/java/app/notifee/core/ForegroundServiceRunLimitReceiver.java +15 -0
- package/android/src/main/java/app/notifee/core/ForegroundServiceRunLimitScheduler.java +461 -0
- package/android/src/main/java/app/notifee/core/NotificationManager.java +6 -0
- package/android/src/main/java/app/notifee/core/event/NotificationEvent.java +6 -0
- package/android/src/main/java/app/notifee/core/model/NotificationAndroidModel.java +29 -0
- package/android/src/main/kotlin/io/invertase/notifee/NotifeeEventSubscriber.kt +3 -0
- package/android/src/test/java/app/notifee/core/ForegroundServiceRunLimitTest.java +2357 -0
- package/android/src/test/java/app/notifee/core/ForegroundServiceTest.java +23 -13
- package/android/src/test/java/app/notifee/core/ShadowServiceCompatibilityTest.java +170 -0
- package/android/src/test/resources/robolectric.properties +4 -0
- package/cli/dist/cli.js +0 -1
- package/cli/dist/commands/initNse.js +1 -2
- package/cli/dist/lib/detectProject.js +1 -2
- package/cli/dist/lib/initNseCore.js +0 -1
- package/cli/dist/lib/logger.js +0 -1
- package/cli/dist/lib/patchPodfile.js +0 -1
- package/cli/dist/lib/patchXcodeProject.js +22 -3
- package/cli/dist/lib/writeTemplates.js +0 -1
- package/cli/dist/lib/xcode.js +6 -0
- package/cli/dist/templates/NotificationService.swift.tmpl +74 -6
- package/cli/package.json +1 -0
- package/cli/vendor/xcode/AUTHORS +6 -0
- package/cli/vendor/xcode/LICENSE +202 -0
- package/cli/vendor/xcode/NOTICE +5 -0
- package/cli/vendor/xcode/README.md +32 -0
- package/cli/vendor/xcode/UPSTREAM-SHA256.json +12 -0
- package/cli/vendor/xcode/index.js +18 -0
- package/cli/vendor/xcode/lib/parseJob.js +32 -0
- package/cli/vendor/xcode/lib/parser/pbxproj.js +1904 -0
- package/cli/vendor/xcode/lib/parser/pbxproj.pegjs +280 -0
- package/cli/vendor/xcode/lib/pbxFile.js +233 -0
- package/cli/vendor/xcode/lib/pbxProject.js +2205 -0
- package/cli/vendor/xcode/lib/pbxWriter.js +309 -0
- package/dist/NotifeeNativeModule.web.d.ts +2 -2
- package/dist/types/Notification.d.ts +12 -1
- package/dist/types/Notification.js +3 -0
- package/dist/types/Notification.js.map +1 -1
- package/dist/types/NotificationAndroid.d.ts +9 -0
- package/dist/types/NotificationAndroid.js.map +1 -1
- package/dist/validators/validateAndroidNotification.js +26 -1
- package/dist/validators/validateAndroidNotification.js.map +1 -1
- package/dist/validators/validateAndroidStyle.js +6 -0
- package/dist/validators/validateAndroidStyle.js.map +1 -1
- package/dist/validators/validateIOSAttachment.js +3 -1
- package/dist/validators/validateIOSAttachment.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -5
- package/src/NotifeeNativeModule.web.ts +2 -2
- package/src/types/Notification.ts +13 -0
- package/src/types/NotificationAndroid.ts +10 -0
- package/src/validators/validateAndroidNotification.ts +31 -1
- package/src/validators/validateAndroidStyle.ts +10 -2
- package/src/validators/validateIOSAttachment.ts +5 -1
- package/src/version.ts +1 -1
- package/cli/dist/cli.bundle.js +0 -20834
- package/cli/dist/cli.d.ts +0 -2
- package/cli/dist/cli.js.map +0 -1
- package/cli/dist/commands/initNse.d.ts +0 -12
- package/cli/dist/commands/initNse.js.map +0 -1
- package/cli/dist/lib/detectProject.d.ts +0 -12
- package/cli/dist/lib/detectProject.js.map +0 -1
- package/cli/dist/lib/initNseCore.d.ts +0 -8
- package/cli/dist/lib/initNseCore.js.map +0 -1
- package/cli/dist/lib/logger.d.ts +0 -4
- package/cli/dist/lib/logger.js.map +0 -1
- package/cli/dist/lib/patchPodfile.d.ts +0 -23
- package/cli/dist/lib/patchPodfile.js.map +0 -1
- package/cli/dist/lib/patchXcodeProject.d.ts +0 -41
- package/cli/dist/lib/patchXcodeProject.js.map +0 -1
- package/cli/dist/lib/writeTemplates.d.ts +0 -11
- package/cli/dist/lib/writeTemplates.js.map +0 -1
- package/cli/dist/templates/templates/Info.plist.tmpl +0 -29
- package/cli/dist/templates/templates/NotificationService.swift.tmpl +0 -100
- package/cli/dist/templates/templates/NotifyKitNSE.entitlements.tmpl +0 -6
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ This fork fills the gap: it preserves all of Notifee's advanced features, migrat
|
|
|
48
48
|
- iOS FCM Mode Notification Service Extension automation via config plugin.
|
|
49
49
|
- Android foreground service manifest configuration via config plugin, with explicit opt-in for foreground service types.
|
|
50
50
|
- Android Expo FCM smoke validation using RNFirebase data-only messages and `notifee.handleFcmMessage`.
|
|
51
|
-
-
|
|
51
|
+
- React Native peer dependency: `>=0.73`; see the [validation scope](https://docs.page/marcocrupi/react-native-notify-kit/react-native/environment-support#react-native-088-validation) for tested versions.
|
|
52
52
|
- Development target: React Native `0.85.3`
|
|
53
53
|
- License: `Apache-2.0`
|
|
54
54
|
- Full changelog: [CHANGELOG.md](CHANGELOG.md)
|
|
@@ -524,8 +524,8 @@ This fork is a complete migration to React Native's **New Architecture**:
|
|
|
524
524
|
- **TurboModules only** — no legacy Bridge support (`NativeModules` replaced with `TurboModuleRegistry`)
|
|
525
525
|
- **Android bridge rewritten in Kotlin** (original was Java)
|
|
526
526
|
- **iOS bridge uses Objective-C++** with `NativeNotifeeModuleSpecJSI` TurboModule conformance
|
|
527
|
-
- **
|
|
528
|
-
- **Toolchain**: Yarn 4, Node 22+, JDK 17+ for Android builds
|
|
527
|
+
- **React Native peer dependency >=0.73**, development target **0.85.3**
|
|
528
|
+
- **Toolchain**: Yarn 4, Node 22+, JDK 17+ for Android builds. Library `minSdk = 24` and `targetSdk = 35`; `compileSdk` inherits a usable `rootProject.ext.compileSdkVersion`, with a minimum/fallback of 35. SDK 37 is not required; the AAR consumer minimum stays at 35, including with AGP 9.
|
|
529
529
|
- **Android JDK baseline**: JDK 17 and JDK 21 are the validated Android build baselines; newer JDKs are not blocked by NotifyKit but depend on the consumer Android toolchain
|
|
530
530
|
- **Single Android module** — the original Notifee shipped a pre-compiled AAR bundled inside the npm tarball under a frozen Maven coordinate; this fork compiles the core from source as part of the React Native bridge module on every consumer build. Eliminates the `FAIL_ON_PROJECT_REPOS` issue on RN 0.74+ and the Gradle cache staleness bug that could serve outdated bytecode after `yarn upgrade`.
|
|
531
531
|
- **Expo CNG development builds** — iOS FCM Mode NSE automation and Android foreground service manifest configuration are available through the config plugin. Android Expo FCM smoke validation uses RNFirebase data-only messages plus `notifee.handleFcmMessage`.
|
|
@@ -536,6 +536,8 @@ This fork is a complete migration to React Native's **New Architecture**:
|
|
|
536
536
|
- **New API: `setNotificationConfig()`** — opt-out flag to prevent Notifee from intercepting iOS remote notification handlers (see [New APIs](#new-apis) below)
|
|
537
537
|
- **Baseline Profile** — the library AAR ships a Baseline Profile that instructs ART to AOT-compile the foreground service notification hot path at install time, eliminating JIT penalty on first invocation
|
|
538
538
|
|
|
539
|
+
Android API 35 and the current WorkManager dependency require **AGP 8.6.0 or newer** (AGP 8.6 requires Gradle 8.7). Higher SDKs need a compatible toolchain: API 36 requires AGP 8.9.1 or newer; API 37 requires AGP 9.1.1 or newer. Select Gradle for the chosen AGP and React Native version using the [Android compatibility tables](https://developer.android.com/build/releases/about-agp). The RN 0.85.3 smoke app remains configured for SDK 36 and Gradle 9.3.1. TypeScript builds, consumer types and client tests have also been validated with RN 0.88.0; Android build and selected device checks covered RN 0.88 with SDK 37. See the [environment support guide](https://docs.page/marcocrupi/react-native-notify-kit/react-native/environment-support#react-native-088-validation) for the scope and remaining limits. Hosts that only configure the app DSL or a version catalog must expose the root extra property before the library is evaluated to opt into a higher SDK. See the [installation guide](https://docs.page/marcocrupi/react-native-notify-kit/react-native/installation) for accepted values, fallback behavior, and standalone build limitations.
|
|
540
|
+
|
|
539
541
|
## Bugs Fixed from Upstream Notifee
|
|
540
542
|
|
|
541
543
|
This fork fixes the following bugs that were never resolved in the original Notifee repository:
|
|
@@ -640,7 +642,7 @@ These changes are documented in the [CHANGELOG](CHANGELOG.md) under the release
|
|
|
640
642
|
|
|
641
643
|
## Foreground Service Setup (Android 14+)
|
|
642
644
|
|
|
643
|
-
**10.8.1 — [Issue #81](https://github.com/marcocrupi/react-native-notify-kit/issues/81):** on Android 12+, the library automatically handles a denied initial foreground promotion non-fatally for an eligible START retried or redelivered by Android after process death.
|
|
645
|
+
**10.8.1 — [Issue #81](https://github.com/marcocrupi/react-native-notify-kit/issues/81):** on Android 12+, the library automatically handles a denied initial foreground promotion non-fatally for an eligible START retried or redelivered by Android after process death. Outside the qualified API 35+ tracked initial denial recovery described below for #82, app-requested START failures retain their existing error handling. This does not guarantee service survival or restart under Android/OEM restrictions. See the [Foreground Service guide](https://github.com/marcocrupi/react-native-notify-kit/blob/main/docs/react-native/android/foreground-service.mdx) for details.
|
|
644
646
|
|
|
645
647
|
Android 14 (API 34) requires all foreground services to declare an explicit `foregroundServiceType`. If you use `asForegroundService: true` in your notifications, add the following to your app's `AndroidManifest.xml`:
|
|
646
648
|
|
|
@@ -667,23 +669,23 @@ Android 14 (API 34) requires all foreground services to declare an explicit `for
|
|
|
667
669
|
|
|
668
670
|
Available types: `camera`, `connectedDevice`, `dataSync`, `health`, `location`, `mediaPlayback`, `mediaProjection`, `microphone`, `phoneCall`, `remoteMessaging`, `shortService`, `specialUse`, `systemExempted`. Choose the type that matches your use case — using the wrong type may cause Google Play policy violations.
|
|
669
671
|
|
|
670
|
-
> **Note:** `shortService` has a 3-minute timeout on Android 14+.
|
|
672
|
+
> **Note:** `shortService` has a 3-minute timeout on Android 14+. Choose a type that matches the actual work and its permitted duration. Timeout handling prioritizes demotion when the callback executes, but timely teardown and JavaScript delivery remain best-effort under Android/OEM restrictions. See the [Foreground Service guide](docs/react-native/android/foreground-service.mdx#handling-fg_timeout).
|
|
671
673
|
|
|
672
674
|
### Foreground service use case guide
|
|
673
675
|
|
|
674
676
|
Choosing the right `foregroundServiceType` matters — the wrong choice can cause Doze-driven CPU suspension with the screen off, Google Play policy rejection, or premature kills by the Android 14+ type-specific timeouts. This matrix maps common use cases to the recommended type and calls out the caveats you need to know before shipping:
|
|
675
677
|
|
|
676
|
-
| Use case | Recommended type | Doze CPU exempt? | Type timeout
|
|
677
|
-
| -------------------------------------------- | -------------------------------------------------- | ---------------- |
|
|
678
|
-
| Silent rest / workout / cooking timer | **`SET_ALARM_CLOCK` trigger — not an FGS** | N/A | N/A
|
|
679
|
-
| Timer with audio cue (metronome, guided set) | `mediaPlayback` | Yes | None
|
|
680
|
-
| Short operation (< 3 min) | `shortService` | No | **3 min**
|
|
681
|
-
| Long-running data sync | `dataSync` | No | 6 h
|
|
682
|
-
| Location / navigation / fitness GPS | `location` | Yes | None
|
|
683
|
-
| Music / podcast / audiobook playback | `mediaPlayback` | Yes | None
|
|
684
|
-
| Bluetooth / USB device sync | `connectedDevice` | No | None
|
|
685
|
-
| Enterprise / DPC / system-critical | `specialUse` or `systemExempted` | Varies | None
|
|
686
|
-
| Arbitrary deferrable background work | **None — use `WorkManager` directly, not an FGS.** | N/A | N/A
|
|
678
|
+
| Use case | Recommended type | Doze CPU exempt? | Type timeout | Key caveat |
|
|
679
|
+
| -------------------------------------------- | -------------------------------------------------- | ---------------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
680
|
+
| Silent rest / workout / cooking timer | **`SET_ALARM_CLOCK` trigger — not an FGS** | N/A | N/A | See the ["Timers: foreground service or `SET_ALARM_CLOCK`?"](#timers-foreground-service-or-set_alarm_clock) decision guide below. |
|
|
681
|
+
| Timer with audio cue (metronome, guided set) | `mediaPlayback` | Yes | None | Must actually play audio — silent `mediaPlayback` is a Play Store policy violation. |
|
|
682
|
+
| Short operation (< 3 min) | `shortService` | No | **3 min** | Native timeout handling and `EventType.FG_TIMEOUT` delivery are best-effort. |
|
|
683
|
+
| Long-running data sync | `dataSync` | No | 6 h cumulative per app/type per 24 h (target API 35+) | Coordinate the shared budget; OEM battery settings do not guarantee execution. |
|
|
684
|
+
| Location / navigation / fitness GPS | `location` | Yes | None | Requires `ACCESS_FINE_LOCATION` runtime permission. |
|
|
685
|
+
| Music / podcast / audiobook playback | `mediaPlayback` | Yes | None | Must be real playback — see policy callout below. |
|
|
686
|
+
| Bluetooth / USB device sync | `connectedDevice` | No | None | Requires companion-device or Bluetooth permission. |
|
|
687
|
+
| Enterprise / DPC / system-critical | `specialUse` or `systemExempted` | Varies | None | `specialUse` requires a `<property>` element and Play Store justification review. |
|
|
688
|
+
| Arbitrary deferrable background work | **None — use `WorkManager` directly, not an FGS.** | N/A | N/A | FGS is not the right abstraction for deferrable work. |
|
|
687
689
|
|
|
688
690
|
> **Warning:** **`mediaPlayback` requires active audio playback.** [Google Play's Foreground Service Types policy](https://support.google.com/googleplay/android-developer/answer/13392821) explicitly prohibits declaring `mediaPlayback` for services that do not play audio. A silent timer, stopwatch, or rest-timer declared as `mediaPlayback` will be rejected during Play Store review. For silent long-running timers, prefer the `SET_ALARM_CLOCK` trigger path (see the decision guide below).
|
|
689
691
|
|
|
@@ -691,10 +693,23 @@ Choosing the right `foregroundServiceType` matters — the wrong choice can caus
|
|
|
691
693
|
|
|
692
694
|
Android 15 (API 35) tightens foreground service restrictions further:
|
|
693
695
|
|
|
694
|
-
- **`dataSync` cumulative 6-hour
|
|
696
|
+
- **`dataSync` cumulative 6-hour budget per app/type in a 24-hour window**, for apps targeting API 35+. A new START or process recreation does not reset it; bringing the app to the foreground resets the allowance under Android's rules. There is no reliable public API for the remaining budget.
|
|
695
697
|
- **`mediaProcessing` is a new dedicated type** for short media transcode / processing operations, with its own timeout.
|
|
696
698
|
- **`specialUse` requires a `<property>` element** on the `<service>` tag with `android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"` and a user-visible justification string. Play Store review uses this property to evaluate the declaration.
|
|
697
|
-
- **
|
|
699
|
+
- **Timeout handling is hardened when the callback can execute.** Native handling prioritizes foreground demotion and coordinates conditional stopping with concurrent STARTs. `EventType.FG_TIMEOUT = 9` is Android-only and delivered best-effort, with optional `startId` and `fgsType`; it does not confirm Android service teardown, cancel JavaScript work, or authorize a restart. Device-level process suspension may still prevent timely handling.
|
|
700
|
+
- **Qualified initial promotion denial on API 35+ is non-fatal.** If Android denies `startForeground()` for an eligible tracked START on a never-promoted instance, the library terminalizes only that request, preserves other pending STARTs, and does not start its runner. This is separate from framework RETRY/REDELIVERY recovery after process death ([#81](https://github.com/marcocrupi/react-native-notify-kit/issues/81)).
|
|
701
|
+
|
|
702
|
+
See the [Foreground Service guide](docs/react-native/android/foreground-service.mdx#android-15-data-sync-timeouts) for timeout handling, interruptible tasks, and the limits of [Issue #82](https://github.com/marcocrupi/react-native-notify-kit/issues/82).
|
|
703
|
+
|
|
704
|
+
**10.9.0: optional best-effort run limit.** Set `android.foregroundServiceBestEffortStopAfterMs` to request a voluntary
|
|
705
|
+
stop attempt for a single `dataSync` foreground run on Android API 35+. It is disabled by default and accepts safe integer
|
|
706
|
+
milliseconds from 60,000 to 18,000,000, starting at the first successful promotion. Same-ID updates do not extend it.
|
|
707
|
+
The internal inexact AlarmManager alarm may arrive minutes late or never; this is not a hard maximum, does not cancel
|
|
708
|
+
JavaScript work, and has not been shown to eliminate vivo/iQOO/OEM timeout crashes. Native handling uses REMOVE and
|
|
709
|
+
selective stopping; the separate best-effort `FG_RUN_LIMIT_REACHED = 10` event does not certify AMS teardown.
|
|
710
|
+
A resolved `displayNotification()` Promise does not confirm alarm scheduling. See the
|
|
711
|
+
[complete contract, failure diagnostics and copyable example](docs/react-native/android/foreground-service.mdx#voluntary-best-effort-run-limit-api-35)
|
|
712
|
+
for validation, process-recreation limits and cooperative cancellation.
|
|
698
713
|
|
|
699
714
|
If you target API 35+, audit your `foregroundServiceType` choice against the matrix above before shipping. The canonical reference is the [Android 15 foreground service behavior changes](https://developer.android.com/about/versions/15/behavior-changes-15#fgs-changes) documentation.
|
|
700
715
|
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import org.gradle.internal.jvm.Jvm
|
|
2
2
|
|
|
3
3
|
buildscript {
|
|
4
|
-
//
|
|
4
|
+
// Legacy standalone declaration only; this folder is not a complete standalone RN build.
|
|
5
|
+
// API 35 and WorkManager 2.11.1 require at least AGP 8.6.0.
|
|
5
6
|
// This avoids unnecessary downloads and potential conflicts when the library is included as a
|
|
6
7
|
// module dependency in an application project.
|
|
7
8
|
if (project == rootProject) {
|
|
@@ -11,7 +12,7 @@ buildscript {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
dependencies {
|
|
14
|
-
classpath("com.android.tools.build:gradle:8.
|
|
15
|
+
classpath("com.android.tools.build:gradle:8.6.0")
|
|
15
16
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24")
|
|
16
17
|
}
|
|
17
18
|
}
|
|
@@ -60,13 +61,46 @@ if (project.hasProperty('reactNativeProjects')) {
|
|
|
60
61
|
project.evaluationDependsOn(':app')
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
// Follow the conventional React Native host property without changing the host's SDK.
|
|
65
|
+
// Only configuration parsing can fall back; SDK/toolchain/build errors must propagate.
|
|
66
|
+
def notifeeCompileSdk = 35
|
|
67
|
+
if (rootProject.ext.has('compileSdkVersion')) {
|
|
68
|
+
def hostCompileSdk = rootProject.ext.get('compileSdkVersion')
|
|
69
|
+
Integer hostApi = null
|
|
70
|
+
try {
|
|
71
|
+
if (hostCompileSdk instanceof Number) {
|
|
72
|
+
hostApi = new BigDecimal(hostCompileSdk.toString()).intValueExact()
|
|
73
|
+
} else if (hostCompileSdk instanceof CharSequence) {
|
|
74
|
+
def sdk = hostCompileSdk.toString().trim()
|
|
75
|
+
if (sdk ==~ /(?:android-)?[0-9]+/) {
|
|
76
|
+
hostApi = new BigDecimal(sdk.replaceFirst(/^android-/, '')).intValueExact()
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
} catch (NumberFormatException | ArithmeticException ignored) {
|
|
80
|
+
// Non-finite numbers, fractions and integer overflow are unusable configuration.
|
|
81
|
+
}
|
|
82
|
+
if (hostApi != null && hostApi > 0) {
|
|
83
|
+
notifeeCompileSdk = Math.max(35, hostApi)
|
|
84
|
+
} else {
|
|
85
|
+
logger.warn("[react-native-notify-kit] Ignoring unusable rootProject.ext.compileSdkVersion " +
|
|
86
|
+
"(type: ${hostCompileSdk == null ? 'null' : hostCompileSdk.getClass().simpleName}); " +
|
|
87
|
+
"expected a positive integer API level or stable android-N identifier in the 32-bit integer range. " +
|
|
88
|
+
"Using compileSdk 35.")
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
63
92
|
android {
|
|
64
93
|
namespace = "io.invertase.notifee"
|
|
65
|
-
compileSdk =
|
|
94
|
+
compileSdk = notifeeCompileSdk
|
|
66
95
|
|
|
67
96
|
defaultConfig {
|
|
68
97
|
minSdk = 24
|
|
69
98
|
targetSdk = 35
|
|
99
|
+
// AGP 9 otherwise defaults the consumer minimum to the inherited compile SDK.
|
|
100
|
+
// Keep the API 35 dependency baseline independent of the SDK used to compile.
|
|
101
|
+
aarMetadata {
|
|
102
|
+
minCompileSdk = 35
|
|
103
|
+
}
|
|
70
104
|
multiDexEnabled = true
|
|
71
105
|
|
|
72
106
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -105,6 +139,18 @@ android {
|
|
|
105
139
|
}
|
|
106
140
|
|
|
107
141
|
testOptions.unitTests.all {
|
|
142
|
+
// RN pins compilation to Java 17. Run tests on the selected build JDK so a JDK 21
|
|
143
|
+
// invocation can simulate newer Android APIs without changing the bytecode target.
|
|
144
|
+
javaLauncher = javaToolchains.launcherFor {
|
|
145
|
+
languageVersion = JavaLanguageVersion.of(jvmMajorVersion)
|
|
146
|
+
}
|
|
147
|
+
// Robolectric's API 36+ FileDescriptor interceptor accesses SharedSecrets on Java 21.
|
|
148
|
+
jvmArgs '--add-opens=java.base/jdk.internal.access=ALL-UNNAMED'
|
|
149
|
+
// Simulation SDKs are independent of compileSdk. API 36/37 require a JDK 21 test JVM;
|
|
150
|
+
// JDK 17 can select earlier APIs with -Drobolectric.enabledSdks=24,26,28,29,30,31,32,33,34,35.
|
|
151
|
+
if (System.getProperty('robolectric.enabledSdks') != null) {
|
|
152
|
+
systemProperty 'robolectric.enabledSdks', System.getProperty('robolectric.enabledSdks')
|
|
153
|
+
}
|
|
108
154
|
testLogging {
|
|
109
155
|
events "failed", "skipped"
|
|
110
156
|
showStackTraces = true
|
|
@@ -164,7 +210,7 @@ dependencies {
|
|
|
164
210
|
|
|
165
211
|
// --- Test dependencies ---
|
|
166
212
|
testImplementation 'junit:junit:4.13.2' // https://github.com/junit-team/junit4/releases
|
|
167
|
-
testImplementation 'org.robolectric:robolectric:4.
|
|
213
|
+
testImplementation 'org.robolectric:robolectric:4.17' // https://github.com/robolectric/robolectric/releases
|
|
168
214
|
testImplementation 'org.mockito:mockito-core:5.19.0' // https://github.com/mockito/mockito/releases
|
|
169
215
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3' // https://developer.android.com/jetpack/androidx/releases/test
|
|
170
216
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' // see above
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
|
26
26
|
android:exported="true" />
|
|
27
27
|
|
|
28
|
+
<receiver
|
|
29
|
+
android:name="app.notifee.core.ForegroundServiceRunLimitReceiver"
|
|
30
|
+
android:exported="false" />
|
|
31
|
+
|
|
28
32
|
<!-- Foreground Service -->
|
|
29
33
|
<service
|
|
30
34
|
android:name="app.notifee.core.ForegroundService"
|