Hello,
Welcome to our Microsoft Q&A platform!
To keep the vibrate process working even when the screen is locked, try to PowerManager
to Partial mode which ensures that the CPU is running when the screen will be turned off.
PowerManager powerManager = (PowerManager)Android.App.Application.Context.GetSystemService(Context.PowerService);
WakeLock wakeLock = powerManager.NewWakeLock(WakeLockFlags.Partial, "MyWakeLock");
wakeLock.Acquire();
//wakeLock.Release(); //close the mode
If you're testing a Xamarin.Forms project, you could use DependencyService to execute the native code in the shared project.
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.