View Single Post
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#1
Hi,
first of all, I'm not an expert using dbus but I wonder, if it is possible to use dbus to show messages on the event-screen of sailfish like on the N9. I started with dbus-monitor and logged for example an incoming email notification:
Code:
...
method call sender=:1.33 -> dest=org.freedesktop.Notifications serial=1070 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "messageserver5"
   uint32 0
   string ""
   string "MY_NAME"
   string "HEADER_OF_MAIL"
   array [
      string "default"
      string ""
   ]
   array [
      dict entry(
         string "x-nemo.email.published-messages"
         variant             string "1400"
      )
      dict entry(
         string "category"
         variant             string "x-nemo.email"
      )
      dict entry(
         string "x-nemo-item-count"
         variant             int32 1
      )
      dict entry(
         string "x-nemo-timestamp"
         variant             string "2014-01-07T19:38:53Z"
      )
      dict entry(
         string "x-nemo-preview-body"
         variant             string "HEADER_OF_MAIL"
      )
      dict entry(
         string "x-nemo-remote-action-default"
         variant             string "com.jolla.email.ui /com/jolla/email/ui com.jolla.email.ui openMessage AAAAAgAAAAV4"
      )
      dict entry(
         string "x-nemo-preview-summary"
         variant             string "MY_NAME"
      )
   ]
   int32 -1
...
So I tried to send a notification via dbus-send
Code:
dbus-send --dest=org.freedesktop.Notifications --print-reply /org/freedesktop/Notifications org.freedesktop.Notifications.Notify string:"" uint32:0 string:"" string:"summary" string:"body"
Error org.freedesktop.DBus.Error.UnknownMethod: No such method 'Notify' in interface 'org.freedesktop.Notifications' at object path '/org/freedesktop/Notifications' (signature 'susss')


The error message is weird, because Notify is a known method
Code:
[nemo@localhost ~]$ dbus-send --session --type=method_call --print-reply --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.DBus.Introspectable.Introspect
method return sender=:1.29 -> dest=:1.807 reply_serial=2
   string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <interface name="org.freedesktop.Notifications">
    <method name="GetCapabilities">
      <arg direction="out" type="as" name="capabilities"/>
    </method>
<method name="Notify">
      <arg direction="in" type="s" name="app_name"/>
      <arg direction="in" type="u" name="replaces_id"/>
      <arg direction="in" type="s" name="app_icon"/>
      <arg direction="in" type="s" name="summary"/>
      <arg direction="in" type="s" name="body"/>
      <arg direction="in" type="as" name="actions"/>
      <arg direction="in" type="a{sv}" name="hints"/>
      <arg direction="in" type="i" name="expire_timeout"/>
      <arg direction="out" type="u" name="id"/>
      <annotation value="QVariantHash" name="org.qtproject.QtDBus.QtTypeName.In6"/>
    </method>
    <method name="CloseNotification">
      <arg direction="in" type="u" name="id"/>
    </method>
    <method name="GetServerInformation">
      <arg direction="out" type="s"/>
      <arg direction="out" type="s" name="name"/>
      <arg direction="out" type="s" name="vendor"/>
      <arg direction="out" type="s" name="version"/>
    </method>
    <signal name="NotificationClosed">
      <arg type="u" name="id"/>
      <arg type="u" name="reason"/>
    </signal>
    <signal name="ActionInvoked">
      <arg type="u" name="id"/>
      <arg type="s" name="action_key"/>
    </signal>
    <method name="GetNotifications">
      <arg direction="in" type="s" name="app_name"/>
      <arg direction="out" type="a(sussasa{sv}i)" name="notifications"/>
      <annotation value="NotificationList" name="org.qtproject.QtDBus.QtTypeName.Out0"/>
    </method>
  </interface>
  <interface name="org.freedesktop.DBus.Properties">
    <method name="Get">
      <arg name="interface_name" type="s" direction="in"/>
      <arg name="property_name" type="s" direction="in"/>
      <arg name="value" type="v" direction="out"/>
    </method>
    <method name="Set">
      <arg name="interface_name" type="s" direction="in"/>
      <arg name="property_name" type="s" direction="in"/>
      <arg name="value" type="v" direction="in"/>
    </method>
    <method name="GetAll">
      <arg name="interface_name" type="s" direction="in"/>
      <arg name="values" type="a{sv}" direction="out"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
    </method>
  </interface>
  <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
      <arg name="xml_data" type="s" direction="out"/>
    </method>
  </interface>
  <interface name="org.freedesktop.DBus.Peer">
    <method name="Ping"/>
    <method name="GetMachineId">
      <arg name="machine_uuid" type="s" direction="out"/>
    </method>
  </interface>
</node>
"
What am I doing wrong?
 

The Following 11 Users Say Thank You to EmaNymton For This Useful Post: