'Xamarin.Forms Tracking location works in Android 10 but not 11

I was following along with Gerald Versluis's tutorial on location tracking on Android. https://www.youtube.com/watch?v=Q_renpfnbk4&t=1995s&ab_channel=GeraldVersluis

I noticed when I ran the project on an Android 10 emulator, it worked perfectly fine. However, once I run it on an Android 11 emulator, it does not work. I know it has something to do with the permissions but I can't find out how to fix it.

Could anyone help me out?

Github repo: https://github.com/jfversluis/XFBackgroundLocationSample



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source