Belou Louga
Belou Louga

Reputation: 1

How keep alive and foreground an app with React Native

My next app will run on a kiosk in a museum. So I'm looking for a way to limit access to other apps (and settings). And then, always keep alive and foreground my app.

After listed the installed apps width react-native-check-app-install and react-native-launcher-kit, I tried react-native-app-locker with an error : cannot read property lockApp After research, I add to the manifest : android.permission.QUERY_ALL_PACKAGES android.permission.CHANGE_COMPONENT_ENABLED_STATE queries intent>

The app still crashes.

So I tried an other way : use AppState to detect when my app is background and restart with react-native-restart or react-native-launcher-kit but it's not working in produce.

Any idea ?

my config : targetSdk: 34 java: 20 React Native: 0.73.6 gradle: 8.3 tests on an Android 11 tab

Upvotes: 0

Views: 144

Answers (0)

Related Questions