Push Notifications with my appserver
-
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-guideBut my questions are: Does this still work and what is the url from the current Push server from Ubports?in
-
-
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?
-
Ah, I have found it. Its https://push.ubports.com/notify
So, I will try to repair the examples now
-
@krille I've asked in the Telegram SG and they told me that
push.ubuntu.comwas shutdown, and that the code/docs haven't been updated. -
@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.
-
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/notifyI 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?
-
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.

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login