UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    How to locally push a system notification ?

    Scheduled Pinned Locked Moved App Development
    10 Posts 5 Posters 799 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • AlainW94A Offline
        AlainW94
        last edited by

        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.

        Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
        Never forget that they are much more ideas inside two heads than in one...

        dobeyD 1 Reply Last reply Reply Quote 0
        • H Offline
          hummlbach
          last edited by

          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.

          AlainW94A 1 Reply Last reply Reply Quote 2
          • AlainW94A Offline
            AlainW94 @hummlbach
            last edited by

            @hummlbach Thank you very much I will take a look at this !

            Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
            Never forget that they are much more ideas inside two heads than in one...

            1 Reply Last reply Reply Quote 0
            • flohackF Offline
              flohack
              last edited by

              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...

              My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

              AlainW94A 1 Reply Last reply Reply Quote 1
              • AlainW94A Offline
                AlainW94 @flohack
                last edited by

                @Flohack That's what I'm looking for ! do you have some examples or link that could guide me on this way ?

                Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
                Never forget that they are much more ideas inside two heads than in one...

                flohackF 1 Reply Last reply Reply Quote 0
                • flohackF Offline
                  flohack @AlainW94
                  last edited by

                  @AlainW94 Sry forgot everything but look in the sources of Dekko 2, it has local notifications for example.

                  My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                  AlainW94A 1 Reply Last reply Reply Quote 0
                  • AlainW94A Offline
                    AlainW94 @flohack
                    last edited by

                    @Flohack This is where I am for now !

                    Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
                    Never forget that they are much more ideas inside two heads than in one...

                    1 Reply Last reply Reply Quote 0
                    • V Offline
                      vandys
                      last edited by

                      FWIW, I used pypi.org/project/notify2/ which uses the dbus, worked for my own notification app.

                      1 Reply Last reply Reply Quote 1
                      • dobeyD Offline
                        dobey @AlainW94
                        last edited by dobey

                        @AlainW94 Are you not implementing this in the telephony-service and dialer-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.

                        AlainW94A 1 Reply Last reply Reply Quote 0
                        • AlainW94A Offline
                          AlainW94 @dobey
                          last edited by

                          @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.

                          Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
                          Never forget that they are much more ideas inside two heads than in one...

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post