Vibration not working in background mode (Ionic/capacitor))

I am working on a project in which the client needs vibration in background-mode.
The method
is working when the screen is on and app is open. But when the screen is off or app is minimized (not killed), the vibration function not working. Anybody know the solution

I found myself…So wrote myself