I am currently working on an app that is designed to access the user's current location and then make requests to an API service based on their position.
There are two main issues I am encountering. Firstly, when the app is first initialized, it prompts the user for permission to access their location, which can take between 10 to 30 seconds to complete. However, I have a controller function that needs to be executed after this process in order to trigger the http get request for the data.
As of now, when I try to run the application, I encounter an error where locationwatch.position is undefined because the preceding steps have not yet been completed.
Could anyone provide me with some example code or advice on how to address this challenge?