Navigation

    UBports Robot Logo

    UBports Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Push Notifications with my appserver

    App Development
    2
    8
    1073
    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.
    • Krille
      Krille last edited by

      Hi there. 🙂 I am new here and using Ubuntu Touch on my Nexus 5 for two weeks now. Its great but Im missing notifications for xmpp. So I was reading in the official Ubuntu Touch documentations, how to build a simple push notification client:
      https://docs.ubuntu.com/phone/en/platform/guides/push-notifications-client-guide

      But my questions are: Does this still work and what is the url from the current Push server from Ubports?in

      advocatux 1 Reply Last reply Reply Quote 0
      • advocatux
        advocatux @Krille last edited by

        @krille hi, see https://github.com/ubports/ubuntu-push

        1 Reply Last reply Reply Quote 0
        • Krille
          Krille last edited by

          Thank you, but it seems that the examples dont work. In the config of the example server is still "push.ubuntu.com". Is this still correct?

          1 Reply Last reply Reply Quote 0
          • Krille
            Krille last edited by

            Ah, I have found it. Its https://push.ubports.com/notify
            So, I will try to repair the examples now 🙂

            advocatux 2 Replies Last reply Reply Quote 0
            • advocatux
              advocatux @Krille last edited by advocatux

              @krille I've asked in the Telegram SG and they told me that push.ubuntu.com was shutdown, and that the code/docs haven't been updated.

              1 Reply Last reply Reply Quote 0
              • advocatux
                advocatux @Krille last edited by advocatux

                @krille I've made a PR to fix the wrong info, if you see anything else please say it here and I'll fix it too.

                1 Reply Last reply Reply Quote 2
                • Krille
                  Krille last edited by Krille

                  Thank you 🙂
                  The last days I was trying to create a push notification. The example client seems to work but the server does not want to run. I get always errors about mongodb and there is no documentation, how to install dependencies and Im not a pro with nodejs ...
                  However I have tried to make a simple POST with curl:
                  curl -d'{"appid":"com.ubuntu.developer.ralsina.hello","expire_on":"2018-05-01T08:33:00.000Z","token":"MYSECRETTOKEN","clear_pending": true,"replace_tag": "tagname","data": {"id": 43578,"timestamp":1409583746,"sender": "Bot","snippet": "Hello World!"}}' -H "Content-Type: application/json" -X POST https://push.ubports.com/notify

                  I have got the token from the clickable logs, but the response from push.ubports is always {"error":"unauthorized","message":"Unauthorized"}. Does anyone know, what have I done wrong?

                  1 Reply Last reply Reply Quote 0
                  • Krille
                    Krille last edited by

                    Hey, I have got it to create a working example!! 🙂

                    https://github.com/ChristianPauly/ut-pushclient-example

                    I have reimplemented the example code snippets from the ancient Ubuntu docs plus a button which sends the POST request and now it works inside the app. This example does not need a server to send push notifications. Maybe I can write a more polished tutorial for other developer in the next days. 🙂

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