Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Foreground Service persistence #274

Open
1 task
dkornilove opened this issue May 10, 2024 · 0 comments
Open
1 task

Android: Foreground Service persistence #274

dkornilove opened this issue May 10, 2024 · 0 comments

Comments

@dkornilove
Copy link

Environment

System: OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa) CPU: (12) x64 AMD Ryzen 5 5600 6-Core Processor Memory: 2.08 GB / 7.76 GB Shell: version: "5.8" path: /usr/bin/zsh Binaries: Node: version: 18.14.0 path: ~/.nvm/versions/node/v18.14.0/bin/node Yarn: version: 1.22.19 path: /usr/bin/yarn npm: version: 9.3.1 path: ~/.nvm/versions/node/v18.14.0/bin/npm Watchman: Not Found SDKs: Android SDK: API Levels: - "23" - "28" - "30" - "31" - "33" - "34" Build Tools: - 28.0.3 - 30.0.2 - 30.0.3 - 31.0.0 - 33.0.0 - 34.0.0 Android NDK: Not Found IDEs: Android Studio: Not Found Languages: Java: version: 17.0.11 path: /home/norzqq/.sdkman/candidates/java/17.0.11-librca/bin/javac Ruby: version: 2.7.2 path: /home/norzqq/.rvm/rubies/ruby-2.7.2-perf/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.74.1 wanted: ^0.74.1 npmGlobalPackages: "*react-native*": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false

Things I’ve done to figure out my issue

I`ve implemented all the diffs from https://react-native-community.github.io/upgrade-helper/?from=0.71.6&to=0.74.1.
Manually installed all the new versions from package.json.

Upgrading version

0.71.6 > 0.74.1

Description

I'm encountering an issue after upgrading from version 0.71.6 to 0.74.1 regarding the persistence of foreground service and notifications. I utilize the @notifee/react-native library to start a foreground service and display notifications. However, I've also experimented with other libraries, all with the same outcome.

Previously, my application exhibited the following behavior: Upon starting a foreground service and assigning value to a global variable (that persists out of App context) on button click, closing the app from the recent apps list resulted in the UI disappearing but the foreground service remaining active. Upon reopening the app from the icon or notification, the UI would remount, but the global variable retained its assigned value.

However, after the upgrade to 0.74.1, the behavior has changed. Now, upon closing the app from the recent apps list, the foreground service disappears. Subsequently, upon reopening the app, the global variable is empty as if it were the first launch.

It's worth noting that all other functionalities of my app are working properly.

Additionally, I cannot reproduce this issue on a freshly created React Native 0.71.4 app; everything works as expected, foreground service not stopping upon closing an app.

I've tried various troubleshooting steps without success and would greatly appreciate any insights or guidance

Reproducible demo

I can not share the app as it is commercial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant