Skip to content

Kar1mMohamed/future_sms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMS package to use Future SMS (EGYPT ONLY).

Features

  • You can send OTP SMS with a simple click.
  • Server-side verification guarantees safety.
  • Future SMS can return firebase custom token to sign in with firebase auth.

Getting started

  • Please contact Kar1mMohamed to get your token at karim@kar1mmohamed.com, please attach your phone number to contact

Usage

  • First of all we need to initilize the package at main.dart before runApp

      FutureSMS.initlize(token: 'YOUR-TOKEN');
  • And then send the otp

          var response = await FutureSMS.instance.sendOTP(
        countryCode: '+20',
        phoneNumber: phoneNumber,
        customText: Constants.otpMessage,
      );
    
      if (response.verificationID != null) {
        CustomSnackBar.success('Code sent successfully'.tr);
        isCodeSent = true;
        sentToPhoneNumber = phoneNumber;
        verificationId = response.verificationID!;
        log('verificationId: $verificationId');
      }
  • Please note that the customText is optional, you can send it without it.
  • To verify the otp

      var response = await FutureSMS.instance.verifyOTP(
          otp: smsCode,
          verificationID: verificationId,
          userUID: phoneNumber.replaceAll('+', ''));
  • userUID is optional, you can send it without it.
  • Use userUID to identify the user in your database.
  • The response here will return that OTP verified successfully or not.
  • If you setted your firebase service account it will return the custom token to sign in with firebase auth.

Thanks

  • You can donate to support me at PayPal Kar1mMohamed

About

SMS package to use Future SMS (EGYPT ONLY).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages