I am able to receive the Sim information however when trying to send SMS with the help of sendSMS method. I am receiving toast "SMS not sent. Something went wrong!"
Tried adding await also since its Future, But still no luck. Also receiving the same toast thrice even though action triggered only one time.
Can you please help me out here?
if (_selectedSimDataModel != null) {
final jsonObject = {
'carrierName': _selectedSimDataModel?.carrierName,
'cardId': _selectedSimDataModel?.cardId,
'countryCode': _selectedSimDataModel?.countryCode,
'displayName': _selectedSimDataModel?.displayName,
'isESIM': _selectedSimDataModel?.isESIM,
'phoneNumber': _selectedSimDataModel?.phoneNumber,
'simSlotIndex': _selectedSimDataModel?.simSlotIndex,
'subscriptionId': _selectedSimDataModel?.subscriptionId
};
debugPrint('jsonObject: $jsonObject');
final key = Utils().generateRandomString(32); // 32-byte key
final iv = Utils().generateRandomString(16); // 16-byte IV
// Create the token
final token =
SecurityUtils.createEncryptedToken(jsonObject, key, iv);
debugPrint('jsonObjectToken: $token');
try {
_simDataPlugin.sendSMS(
phoneNumber: "+911234567890",
message: "D8E8G $token",
subId: _selectedSimDataModel!.subscriptionId,
);
} on Exception catch (ex) {
debugPrint(ex.toString());
}
}
},
I am able to receive the Sim information however when trying to send SMS with the help of sendSMS method. I am receiving toast "SMS not sent. Something went wrong!"
Tried adding await also since its Future, But still no luck. Also receiving the same toast thrice even though action triggered only one time.
Can you please help me out here?