I have an answer for this in Xamarin Forms. Let's do the same for Maui too.
For iOS, this is not possible and even if you somehow get it using CoreTelephony
or something else your application would get rejected for apple store deployment with the below issue as stated by Dylan here:
"For security reasons, iPhone OS restricts an application (including its preferences and data) to a unique location in the file system. This restriction is part of the security feature known as the application's "sandbox." The sandbox is a set of fine-grained controls limiting an application's access to files, preferences, network resources, hardware, and so on."
The device's phone number is not available within your application's container. You will need to revise your application to read only within your directory container and resubmit your binary to iTunes Connect in order for your application to be reconsidered for the App Store.
Now for Android, you could use the TelephonyManager
approach to get the phone number, but in my knowledge, it is not a reliable approach to do so it does not get the phone number from the SIM details or something it picks it up from the device information that you enter at the phone's startup an explanation for it is present here
Also, there is an important comment here that seems to be relevant
Actually, not so perfect. Last time I tried this method, it reported the phone number that my phone originally had, before my old mobile number was ported over to it. It probably still does, as the Settings app still shows that defunct number. Also, there are reports that some SIMs cause this method to return null. That being said, I'm not aware of a better answer.
Even if this somehow is fine with you, you can only get one phone number using this and this phone number would be null most of the times if your user is not configured in the mobile's settings.
Possible solution (only if you ask me)
The way in which both these issues could get solved is, creating a screen something like a pop-up or a page according to your convenience that asks the user himself to enter the phone number if mandatory make a modal page all together.