I am building a flutter app and I am asking the user to enter their phone number to get started with signup on the landing page just after the splash screen. I do not wish to ask location permission at this stage because I feel it will affect the user's experience.
I had a look at the Telegram and Twitter apps and noticed they are detecting the dialling code even without asking for android permissions.
I am assuming they get the users country and then based on that display the dialling code. But how do they get the country and is it legal to get the country code without asking for user's permission?