Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived Talk:Send SMS using Qt Mobility

From Wiki
Jump to: navigation, search

Hello,

This code is only appropriate for 1.0-tp. The QMessageServiceAction class is not in 1.0 and higher. Consider

int main(int argc, char** argv)
{
   QCoreApplication consoleApplication(argc,argv);
   QMessage testMessage;
   testMessage.setType(QMessage::Sms);
   testMessage.setParentAccountId(QMessageAccount::defaultAccount(QMessage::Sms));
   testMessage.setTo(QMessageAddress(QMessageAddress::Phone,"1234567890"));
   testMessage.setBody("Hello there from test program");
   QMessageService testService;
   bool result = testService.send(testMessage);
   std::cout << "Send message result " << (result ? "Ok" : "Failed") << std::endl;
   return result ? 0 : 1;
}  

an example from qt mobility bug 64 https://bugreports.qt-project.org/browse/QTMOBILITY-64

-jk

Capability for sending SMS

You need to add NetworkServices to the capability list. Man this silly bug costed me 3 days!!! :((

This page was last modified on 30 April 2013, at 05:58.
17 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×