How to locally push a system notification ?
-
Hi all, do you have any idea, or better, any code example of pushing locally a notification like the system does ? That's for my visual voice mail application, I don't want to have to register it through the UbPorts server as the notification will be locally generated.
Thanks in advance for your help as always.
-
Stuff that could help:
- https://github.com/ChristianPauly/pushclient
- https://docs.ubports.com/en/latest/appdev/guides/pushnotifications.html
- pinging @Krille
Actually I would hope you get an idea from reading the push notification doc above what you need to have the notification locally only and what you can omit.
-
@hummlbach Thank you very much I will take a look at this !
-
Note that for local notifications you do not need to use the push API, it all goes through postal or whats the name of this...
-
@Flohack That's what I'm looking for ! do you have some examples or link that could guide me on this way ?
-
@AlainW94 Sry forgot everything but look in the sources of Dekko 2, it has local notifications for example.
-
@Flohack This is where I am for now !
-
FWIW, I used pypi.org/project/notify2/ which uses the dbus, worked for my own notification app.
-
@AlainW94 Are you not implementing this in the
telephony-service
anddialer-app
code? The former already has plenty of code for popping the notifications for incoming call or sms/mms.Edit: Oh, and there's already a voice mail thing, so you'd probably need to tweak there anyway to avoid multiple notifications for it, and so the visual voicemail page is opened, rather than calling the voicemail number.
-
@dobey Hi, at the beginning i was thinking about coding everything into ofono then push notification to the dialer-app. In the mean time, as we have to handle imaps I though that it was better to do it in a separate process, just in case that the app crash because of a connection lost. That's why I was thinking about pushing notifications from this other process to the dialer app. I was not aware about telephony-service (or it come out of my mind while thinking about the project). Actually I modified ofono for pushing VVMMessage signal over dbus to my process, the I handle the imap and a separate sqlite database that store the list of messages and the imap configuration, I'm able to download the messages locally. I have to modify the dialer-app, it will have to read the DB and to require the message download or deletion over DBUS through my process. I think this way is less intrusive for the overall telephony apps. As far as I can read over the net, it seem that they did the same way on Android.
https://source.android.com/devices/tech/config/voicemail
What do you think about that ?
A last but important point, my secure imap connection is made by using curl, I'm a little scared because I don't see the libcurl natively on the file system, I hope that we could add it ! otherwise, I will have to use an other library.