releans_verify 1.0.1 copy "releans_verify: ^1.0.1" to clipboard
releans_verify: ^1.0.1 copied to clipboard

outdated

releans verify plugin

releans_verify #

In this plugin, you can send and verify OTP through releans API

import #

import 'package:releans_verify/releans.dart';

init releans #

  • copy API key from releans dashboard and set the apiKey
  • create sender from releans dashboard and set the sender
void main() async {
  ReleansVerify().init(
      apiKey: "XXXXXXXXXXXXXXXXX",
      sender: "XXXXXXXXX");
  runApp(MyApp());
}

send OTP #

  • call sendCode with mobile number
  • mobile number should contain the country code
  • specify channel (default is sms)
  ReleansResult result =
  await ReleansVerify().sendCode(mobile: "+9715200000");

  ReleansResult result = await ReleansVerify()
    .sendCode(mobile:"+9715200000",channel: Channel.voice);

verify OTP #

  • call verifyCode with user entered code and mobile number
 ReleansResult result = await ReleansVerify().verifyCode(
                          code: "0000", mobile:"+9715200000");

handle result #

  • ReleansResult object will return after sendCode and verifyCode methods
  • view response message by using reult.message
  • check request is success by using result.isSuccess()
    //print message
    log("message ${result.message}");
    //print status code
    log("status ${result.status}");
    //check request is success
    log("isSuccess ${result.isSuccess()}");

Authors #