【问题标题】:Permission regarding launching dial flutter关于启动拨号颤动的权限
【发布时间】:2020-12-05 15:37:48
【问题描述】:

在 url_launcher 的帮助下启动拨号盘(电话)是否需要征求用户的许可?

这是基本代码

launchURL(String number) async {
if (await canLaunch(number)) {
  await launch(number);
} else {
  throw 'Could not launch $number';
 }
}

只需简单地用数字启动

【问题讨论】:

    标签: flutter url permissions manifest launcher


    【解决方案1】:

    请参阅此链接以获得答案。有用。基本上,你需要在manifest中添加相关的权限,你就完成了。

    <manifest>
    
    <!-- Nest within the manifest element, not the application element-->
    <queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="https" />
        </intent>
        <intent>
            <action android:name="android.intent.action.DIAL" />
            <data android:scheme="tel" />
        </intent>
        <intent>
            <action android:name="android.intent.action.SEND" />
            <data android:mimeType="*/*" />
        </intent>
    </queries>
    
    <application>
        ....
    </application>
    

    https://stackoverflow.com/a/65082750/6032764

    【讨论】:

    【解决方案2】:

    不,但如果您正在开发一个想要访问互联网的应用程序,则必须添加互联网权限。

    【讨论】:

    • 您能否再次查看我的问题,我添加了代码以更清晰......谢谢
    • 您无需权限即可打开拨号盘、默认消息应用程序或电子邮件/Gmail
    • 里面有数字吗?
    • 你能复习一下这个问题stackoverflow.com/questions/67319152/…
    【解决方案3】:

    实际上 URL 启动器是 pub.dev 中的一个预配置插件,只需将其添加到您的 pubspec.yaml 文件中即可。

    【讨论】:

      猜你喜欢
      • 2015-11-18
      • 2012-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多