Galaxy S20 lock screen on stops GPS

I have a problem running my application in background when lock screen is on. It stops the GPS location. App is not optimized for battery, its able to run in background. How to enable or what permissions are required for GPS to be running while the lock screen is on? Please let me know.
Giridhar Kandachar