[SailfishDevel] LED Notification

george b scooterschorschi at gmail.com
Tue Apr 5 19:57:52 UTC 2016


Hi

In case someone come here, searching for same issue:

Notification with blinking LED example....

using QML Bindings and example from doc, just exchange the category from
'x-nemo.example'  to 'x-nemo.messaging.im'

Button {
    Notification {
        id: notification
        category: "x-nemo.messaging.im"
        summary: "Notification summary"
        body: "Notification body"
        onClicked: console.log("Clicked")
    }
    text: "Application notification" + (notification.replacesId ? "
ID:" + notification.replacesId : "")
    onClicked: notification.publish()
}


Example, using golang:
func notifiyUser(title string, body string) error {
        conn, err := dbus.SessionBus()
        if err != nil {
                return err
        }

        var m map[string]dbus.Variant
        m = make(map[string]dbus.Variant)
        m["category"] = dbus.MakeVariant("x-nemo.messaging.im")

        obj := conn.Object("org.freedesktop.Notifications",
"/org/freedesktop/Notifications")
        call := obj.Call("org.freedesktop.Notifications.Notify", 0, "",
uint32(0),
                "", title, body, []string{},
                m,
                int32(0))
        if call.Err != nil {
                return err
        }
        return nil
}


Of course, in real app, one should use own category files as pointed out by
Andrey.

Bye
Georg

2016-03-31 20:28 GMT+02:00 Andrey Kozhevnikov <coderusinbox at gmail.com>:

> no problems if you write own dbus wrapper for notification calls, it's
> very documented. same for profiled dbus for changing led colors.
>
> ------ Исходное сообщение ------
> От: "george b" <scooterschorschi at gmail.com>
> Кому: "Sailfish OS Developers" <devel at lists.sailfishos.org>
> Отправлено: 01.04.2016 0:27:06
> Тема: Re: [SailfishDevel] LED Notification
>
>
> Hello
>
> Thanks for all the replays.
> The textsecure backend is written in Go. It's possible to use the c++
> library within go, but I think the more 'natural' way would be the d-bus
> communication. I will investigate more about the d-bus communication and
> have a look at other clients to see how I must implement this notification.
>
> Bye
> Georg
>
> 2016-03-31 8:42 GMT+02:00 Кожевников Андрей Андреевич <
> coderusinbox at gmail.com>:
>
>> For extra pro led configuration for notification events you can check
>> this repo: https://github.com/CODeRUS/sailfish-led-config
>> using these configs you can change led color for your notifications in
>> realtime
>>
>> 31.03.2016 01:08, george b пишет:
>>
>> Hi
>>
>> I am working on a port of the textsecure App from the Ubuntu Phone.
>> Basic Text messaging is working between my jolla and an android phones
>> Signal App.
>>
>> Now I want to implement notifications on new incoming messages. I can't
>> figure out how to do this. I read something about the use of D-Bus for
>> this. There is also a qml binding [1]. The example only leads to a simple
>> text on the messages screen. No real Notification is triggered.
>>
>> Can someone point me in the right direction on this issue?
>>
>> Bye
>> Georg
>>
>>
>>
>> [1]
>> https://sailfishos.org/develop/docs/nemo-qml-plugin-notifications/qml-org-nemomobile-notifications-notification.html/
>>
>>
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org
>>
>>
>>
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>> To unsubscribe, please send a mail to
>> devel-unsubscribe at lists.sailfishos.org
>>
>
>
> _______________________________________________
> 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/20160405/481d1d50/attachment.html>


More information about the Devel mailing list