How Can I prevent user from using the app when the location service is off

I want to prevent the user from using the app when he turns of the location or if he doesnt give permission to the app to get the location.
I need to popup a dialog or a screen, that would inform the user that he needs to turn on the location to contiune using the app. The “Turn on your location” screen or dialog, should popup whenever the location service is off, and at any part of the app (except when the user is trying to register or login).