2

I uploaded the app to the appstore. According to the feedback I get, the screen stays on all the time. How can I solve this problem?

I wondered if the screen stays on because the devclient is open. But if I'm not mistaken, the applications we developed before were closing. I am using expo-av in the app. Could it be that it pretends to play sound and is trying to keep it on? But I removed all the code in the app.jsx file, only remained. But still the screen stays on. There is nothing in imports except react. What could be causing the problem?

2 Answers2

1

It's on by default https://github.com/expo/expo/issues/20328

What I do is

KeepAwake.deactivateKeepAwake()

As documented in KeepAwake

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265
1

I added the following control to package.json.

"expo": {
   "autoLink": {
     "exclude": ["expo-keep-awake"]
   }
}

Then I added the following command in useEffect in app.jsx.

deactivateKeepAwake();
  • First of all, I got the build like this and tried it. Now the screen goes into sleep mode.
  • Then I removed the change in package.json and got build again and tried it. The screen goes to sleep again.
  • And finally I re-added the change in package.json. Then I removed the deactivateKeepAwake() command in app.jsx. This is how I got the build and the screen goes to sleep again.

In all three scenarios, the screen goes to sleep.