[SailfishDevel] Opening messaging app from qml.
Alexander Maliyev
alex.maliyev at inbox.ru
Tue Jul 21 11:49:16 UTC 2015
Hi,
You can open messaging app with dbus call. C++ code will look like this
void MyClass::composeSMS(const QString &number)
{
if (!number.isEmpty()) {
QDBusMessage message = QDBusMessage::createMethodCall(
"org.nemomobile.qmlmessages",
"/",
"org.nemomobile.qmlmessages",
"startSMS");
QList<QVariant> arg;
arg << number;
message.setArguments(arg);
QDBusConnection bus = QDBusConnection::sessionBus();
if (bus.isConnected()) {
bus.send(message);
}
}
}
for qml you should use qml dubs plugin to call dubs method
regards
On Jul 21, 2015, at 5:36 PM, neotericdeveloper at gmail.com wrote:
> Hello Sailors..
>
> I tried to open default messaging app using the below code(qml). But its not invoking the msg app.
>
> Qt.openUrlExternally("sms:?body=msgtosend");
>
> I also tried this one by providing dummy phone number.
>
> Qt.openUrlExternally("sms:0123456789?body=msgtosend");
> Still not working.
>
> How can i successfully open the messaging app with text to send from qml.
>
> Any help.
> Thanks in advance.
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20150721/ebce19fc/attachment.html>
More information about the Devel
mailing list