简体   繁体   English

如何在 Flutter 中自动发送短信或电子邮件验证

[英]How send SMS or Email verification automatically in Flutter

How can I send for example SMS code verification in Flutter (without Firebase Auth because I have MySQL database with PHP connection).如何在 Flutter 中发送例如 SMS 代码验证(没有 Firebase Auth,因为我有 MySQL 数据库和 PHP 连接)。

I have tried :我努力了 :

Future<void> _sendCode(String phoneNumber) async
  {
    phoneNumber = "XX XX XX XX XX";
    String code = _createCode();
    String message = "The code is $code";

    String uri = 'sms:$phoneNumber?body=$message';
    await launchUrlString(uri);
    
  }

And many other things, but it open messaging on my device.还有很多其他的东西,但它会在我的设备上打开消息传递。 I want the code to be sent automatically .我希望自动发送代码

I have tried to find out how to send a message from PHP but without satisfactory result.我试图找出如何从 PHP 发送消息但没有令人满意的结果。

You can try flutter_otp package I think it's the best option,你可以试试 flutter_otp 包我认为这是最好的选择,

You can visit https://pub.dev/packages/flutter_otp for more info,您可以访问https://pub.dev/packages/flutter_otp了解更多信息,

您也可以使用url_launcher包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM