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

Push Notifications with my appserver

Scheduled Pinned Locked Moved App Development
8 Posts 2 Posters 1.5k 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.
    • K Offline
      Krille
      last edited by 27 Apr 2018, 06:27

      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

      A 1 Reply Last reply 27 Apr 2018, 07:06 Reply Quote 0
      • A Offline
        advocatux @Krille
        last edited by 27 Apr 2018, 07:06

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

        1 Reply Last reply Reply Quote 0
        • K Offline
          Krille
          last edited by 27 Apr 2018, 09:59

          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
          • K Offline
            Krille
            last edited by 27 Apr 2018, 12:25

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

            A 2 Replies Last reply 27 Apr 2018, 14:27 Reply Quote 0
            • A Offline
              advocatux @Krille
              last edited by advocatux 27 Apr 2018, 14:27

              @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
              • A Offline
                advocatux @Krille
                last edited by advocatux 27 Apr 2018, 14:51

                @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
                • K Offline
                  Krille
                  last edited by Krille 5 Jan 2018, 13:00 1 May 2018, 07:30

                  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
                  • K Offline
                    Krille
                    last edited by 1 May 2018, 21:36

                    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
                    3 out of 8
                    • First post
                      3/8
                      Last post