×
Namespaces

Variants
Actions

Archived Talk:Send SMS using Qt Mobility

From Nokia Developer 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 08: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.

×