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 # ???
Asked
Active
Viewed 1,051 times
1
-
https://stackoverflow.com/a/43889379/217408 – Günter Zöchbauer Dec 12 '18 at 13:51
2 Answers
5
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.
Ashutosh Dave
- 382
- 16
- 33
5
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#'));
Dhrumil Shah - dhuma1981
- 15,166
- 6
- 31
- 39