问题
In flutter app i am using Url_launcher dependency to open phone application with content to dial using following function Url_launcher.launch("tel:\*5*250#" ). It does open the application but # symbol is not dialed in there else everything works ok ... Any workaround to include # ???
回答1:
I found this issue only on Android devices. It works on iOS.
You need to use URL encoding for special character in a URL.
So # equals %23
This will work launch('tel:\*5*250\%23');
This answer helped me.
回答2:
The easiest and safest way is encode the mobile number typed by user and pass it through
Uri.encodeComponent(numberTypedByUser)
Like this.
launch("tel:" + Uri.encodeComponent('*5*250#'));
来源:https://stackoverflow.com/questions/53737159/add-sign-in-tel-uri-using-url-launcher