Last updated:
0 purchases
future sms
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 [email protected], 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');
copied to clipboard
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');
}
copied to clipboard
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('+', ''));
copied to clipboard
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
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.