Flutter url_launcher软件包不适用于iOS设备
我正在为我的项目使用Flutter url_launcher: ^6.0.20
。但这对iOS设备不起作用,但是它对Android设备无问题。
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () async {
final contact = contactNumber;
await launch('tel:$contact');
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Hotline - ',
style: TextStyle(
fontSize: 25.0,
fontWeight: FontWeight.bold,
),
),
Text(
contactNumber,
style: const TextStyle(
fontSize: 25.0,
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline),
),
],
),
),
ContactNumber
即将形成后端API。我将该值分配给了Contactnumber变量。
这是下面的软件包,
https://pub.dev/packages/url_launcher
I'm using flutter url_launcher: ^6.0.20
for my project. but it's not working for iOS devices but it's working for the android devices without any problem.
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () async {
final contact = contactNumber;
await launch('tel:$contact');
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Hotline - ',
style: TextStyle(
fontSize: 25.0,
fontWeight: FontWeight.bold,
),
),
Text(
contactNumber,
style: const TextStyle(
fontSize: 25.0,
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline),
),
],
),
),
contactNumber
is coming form the backend api. and I've assigned that value to contactNumber variable.
here is the package below,
https://pub.dev/packages/url_launcher
It's working properly for android. not working for the iOS. there is no error on the code. Is the problem in the package.?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建一种呼叫的方法。
然后致电打开:
Create a method for make a call.
then call on onPressed:
试试看,它是为我工作
启动(“ Tel:// 1234567890”);
>try it, it was worked for me
launch("tel://1234567890");