1

I'm working on a SOS app that is supossed to send emails and/or sms when the user needs it to. This will happen using the contacts that the user added to the app. At the moment the user can add 4 of these contacts, regardles of the type (email/sms).

I'm already able to send sms OR emails using

await ChatMessageManager.ShowComposeSmsMessageAsync(chatMessage);

or

await EmailManager.ShowComposeNewEmailAsync(emailMessage);

The problem is doing both things, one after the other.

If I call both of this functions at the "same time", only one of them will show the respective page. Since OnNavigatedFrom and OnNavigatedTo events do not fire in these conditions, is there any other kind of event that fires when it comes back from the pages or some other way to wait until one of the pages is dismissed?

Thanks

pmartins
  • 11
  • 3
  • Have you tried to add a listener for when the app reactivates? When it does, you may presume that the SMS was at least attempted. Also, have a look at this: http://stackoverflow.com/questions/14488587/how-to-allow-for-multiple-popups-at-once-in-winrt. It's not exactly the same, but very similar in terms of a problem. – WiredPrairie Jun 01 '15 at 14:15
  • @WiredPrairie For some reason nothing seems to fire in this particular case. I've already tried all possible Page and Application events that could do something to help me but with no success. As far as I can understand, once the sms page is loaded, there's nothing I can listen to afterwards. Thanks for that link, I have not been successful yet with the approach, but maybe it will work. – pmartins Jun 02 '15 at 10:01

1 Answers1

0

Ok I've found the solution

Window.Current.VisibilityChanged 

fires in this case. I'm able to figure out when the application is getting visible again and assume that the SMS was treated, launching the email at this stage.

I just start listening to the event before composing the SMS and release it when it comes back. It seem so simple now..

(Still don't know why OnNavigatedTo doesn't work)

Launch 2 SMS Compose tasks in Windows Phone 8.1 RT App pointed me in the right direction.

Community
  • 1
  • 1
pmartins
  • 11
  • 3