I am working on an application where I am using Google Push Notification. The application receives a notification when it is running in Xiaomi phone. Otherwise, when it's killed, it does not receive a notification.
If we want to receive a notification if the application is killed then we need to allow auto restart app manually from the security app of Xiaomi. I want any trick to do this programmatically without asking the user. Is there a way to do this?

As for my understanding, once you clear apps or clear memory in the Recent Apps menu, Xiaomi (or MIUI ROM) will force close all the services and memory related to that app similar to user going to settings and force stopping the app.
This link talks about the same issue, hence all the Broadcast receivers and Services will be ended unless started by the user again, so the notification won’t be received.
However, you can try just enabling auto-start for your app permissions in settings and if it still doesn't work, try creating a service that restarts by itself and enable auto-start in the settings, AutoStart is very important in MIUI, until it’s enabled all the notification or app activity will be force closed and will never start.