-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Description
I am not getting the success callback even I sent the SMS to the selected recipient. Every time I am getting a canceled callback.
Here's my code --
requestSMSPermission = async () => {
if (Platform.OS === 'android') {
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.READ_SMS,
{
title: 'Sms Permission',
message: 'App needs Sms permission',
},
);
return granted === PermissionsAndroid.RESULTS.GRANTED;
} catch (err) {
console.log(err);
return false;
}
} else return true;
};
sendSMS = async (selectedContacts) => {
let permission = await this.requestSMSPermission()
if (permission) {
SendSMS.send(
{
body: "Hello I am using App",
recipients: selectedContacts,
successTypes: ['sent', 'queued', 'failed', 'outbox'],
},
(completed, cancelled, error) => {
if (completed) {
console.log('SMS Sent Completed');
} else if (cancelled) {
console.log('SMS Sent Cancelled');
} else if (error) {
console.log('Some error occured');
}
},
);
}
}
nitish173 and bibekgurunguh
Metadata
Metadata
Assignees
Labels
No labels