Skip to content

Unable to get success callback even i sent the message successfully. #95

Open

Description

@chetan-sharma-newput

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');
					}
				},
			);
		}
	}

Activity

  1. tkporter commented on Jun 14, 2021

    @tkporter
    Owner

    What device are you running this on?

  2. chetan-sharma-newput commented on Jun 14, 2021

    @chetan-sharma-newput
    Author

    What device are you running this on?

    I was using Xiaomi A3 android device, Android 10 version.

  3. kpc0511 commented on Jul 1, 2021

    @kpc0511

    Hi @tkporter, this issue is resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions