1

I'm trying to send an sms from c# WindowsPhone7/8 like this:

SmsComposeTask smsComposeTask = new SmsComposeTask();
smsComposeTask.To = smsPhonenumberToSend;
smsComposeTask.Body = smsMessageToSend;
smsComposeTask.Show();

this works, the sms is sent, but after the user accepts (or declines) to send the sms I want to do some calculation in code behind.

Is there a way to attach some callback method and fetch the status of sms composer task?

If this can't be done by the SMScomposer, please guide me if there is any other way in WP to send and sms and get info if it was sent or not.

3
  • AFAIK, it's not possible.
    – ken2k
    Commented Feb 13, 2014 at 12:54
  • there is no way i can get information if user sent the sms or declined?? Commented Feb 13, 2014 at 12:55
  • Yes, I don't think it's possible. Show() is a void, so you won't have any information from here. And I'm not aware of any mechanism around Tasks that allows things like callbacks.
    – ken2k
    Commented Feb 13, 2014 at 12:56

1 Answer 1

2

Windows Phone Tasks divide into Launchers and Choosers. Choosers allow you to attach an event handler to execute when the Task completes. SmsComposeTask is a Launcher. You cannot get any information about user's decision. When you want to react to user returning to application after the Task completed (whether user send the Sms or not), override Page.OnNavigatedTo (using some flag).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.