【问题标题】:How to do phone authentication in flutter using http post request?如何使用http post请求在flutter中进行电话身份验证?
【发布时间】:2019-12-27 10:20:59
【问题描述】:

我正在尝试,但作为回应,没有输入号码。我有一个 post api,它给了我一个 OTP,它将我带到下一个屏幕进行注册。

//In below code i get response.

createPost(String url, {Map body}) async {
                            return http
                                .post(url, body: body)
                                .then((http.Response response) {
                              print("Response" + response.body);//response get from api

                              return Post.fromJson(json.decode(response.body));
                            });
                          }
    //I am taking number as a string
                          Post newPost = new Post(
                              usernumber: _numbercontroller.text,
                              contrycode: code.toString()
                          );//contrycode taken ans var datatype
                          Post p = await createPost(url, body: newPost.toMap());

                          print("Number --> " + newPost.usernumber);//here did not get mobile number
                        },

当我输入手机号码时,我会从 API 获取 otp 号码进行注册。

【问题讨论】:

    标签: http flutter verification one-time-password


    【解决方案1】:

    请检查 API。如果输入的电话号码没有收到,则意味着您的回复有所不同。请详细说明 API 的响应。

    【讨论】:

      猜你喜欢
      • 2018-10-15
      • 2023-03-10
      • 2012-02-29
      • 2020-02-21
      • 2014-09-20
      • 2022-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多