What to do when widget is not refreshing on Xiaomi phones with MIUI ROM

MIUI ROM comes with their very specific implementation of app security and battery optimization. It causes that our app is either not started after phone restart or is killed. If you configure your device properly, our app will start working again. MIUI Developer Team is breaking Android standards so we can't fix it anyhow. But you can configure your device to work better.

Enabling auto start of the app

1. Tap on the Security app from the app screen.

You will not find this if you enter from the Settings menu, you have to tap directly on the app icon.

2. Once in the Security app, tap on Permissions.

3. Tap on Autostart.

4. Make sure our app has toggle enabled

 

Prevent MIUI from killing background apps

You case instructions on this YouTube video:

More info and discussion at this XDA thread