-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to host my own push notification gateway ?? #8692
Comments
From the docs
|
@AmShaegar13 |
That's how I understand it, yes. I assumed you already have your own instance of RocketChat running. If that's not the case you probably should explain your setup and what you want to achieve a bit more. |
The gateway is only needed if you would like to use our official apps from the app store. This is the only way we are able to deliver your push notifications to the app. If you do not want to use our push gateway then you will need to compile your own apps. You don't need a gateway in that case though... you just need to build the apps with the GCM and Apple push information and then set inside of Rocket.Chat But in no case should you need a push gateway. This is simply a feature to allow us to deliver push notifications to you when you use our official apps. |
@geekgonecrazy, can you elaborate a bit more about what travels through Rocket.Chat gateways? I think that most people that self-host their server are interested in maintaining privacy control of the messages exchanged on their RC instances, and it is not clear what actually goes back and forth between self-hosted instances and the RC gateway WRT notifications. More specifically, are message contents sent to RC servers upon notifications? What exactly is sent to RC server? Any insight will be appreciated. [Edit: opened a new issue to track this: #9027] |
@arminfelder is working on a push gateway. We need it for our fairchat app, which allows to connect to any RocketChat server, but we can't share private keys for GCM. |
as @rasos pointed out, I wrote a small pushgateway for RocketChat, please feel free to give me feedback: https://git.fairkom.net/chat/RocketChatMobilePushGateway |
To confirm the instructions here do not work for Google Play Store apps and you have to use the gateway? https://rocket.chat/docs/administrator-guides/notifications/push-notifications/ |
@caesarcxiv the android application is registering it self with Google Firebase Messaging(formally GCM), by using given credentials, built into the app, the app then sends the received push token to the Rocket.Chat Server you are connected to. The RC server then send notifications using the API key, which is related to the key the app is using, together with the token as recipent to google, which is then sending it to the mobile. |
Hi @arminfelder, I'm testing out your gateway server https://git.fairkom.net/chat/RocketChatMobilePushGateway but having blocking issues. I'm receiving a stdout log from the executable
I'm compiling the push gateway from source and expose the port 11000 to 80 via Nginx reversed proxy. Unsure if my Nginx reversed proxy config is correct but Content-length header is missing when reaching Google GCM server. I'm no C++ coder, so just checking with you if your RocketChatMobilePushGateway already pass the Content-length header. I'll keep checking my Nginx config at my side. |
@trongthanh I just created a branch "debug", with some additional debug information. For me it looks like there is no data attached at all, because, libcurl is setting the content-length automatically, please check your serverKey.txt file |
OK, I'll do another round of tests tomorrow. Thanks. |
This comment was marked as resolved.
This comment was marked as resolved.
@trongthanh I have fixed the issue, it was related to your newline char at the end of the google key, which did destroy the http header, I added a line to remove all \n from the key after reading it into memory. the key you need is the one called "Server key": I think the GCM key should also work, but its legacy... p.s I also switched on compiler optimizations, now it should run fine with about 1MB of RAM :) |
@arminfelder Thanks for your quick response. We're making really good progress. For me, the GCM / FCM push is working now though there is no proper icon, thumbnail for the notification. Maybe I have to fix it in the GooglePushModel.cpp, right now only Besides, I was too focus on the GCM issue that I didn't notice that push notification doesn't work for Apple / iOS devices either. When I try obmitting BTW, when I try to install the Ubuntu package: |
@trongthanh I used ubuntu 17.10 on my dev computer, and debian stretch for the Docker image, |
@trongthanh there is a small bug in @arminfelder's gateway affecting iOS push messages, I've created an issue about it and fixed it in this fork https://github.com/q210/RocketChatMobilePushGateway (also fixed Docker file, it can be built now) |
Hi Everyone, I also needed a self-hosted push gateway but I didn't want to hassle with FCM, so I went on another route. My simple gateway implementation is in Python, uses Apprise to connect to Gotify (or other notification providers), runs in Docker, and it's easy to setup with docker-compose. For a few users, it provides a viable alternative instead of using gateway.rocket.chat and the Google ecosystem. If you're interested, give it a try :) https://github.com/immanuelfodor/rocketchat-push-gateway |
Important to remind that doing this does require building the mobile apps and getting them distributed to your users |
Since my solution uses a separate app (e.g. Gotify) to receive the push notifications, you can use the official RC app. The Gotify mobile app uses websockets to get the push messages, and even with excluding it from battery optimization, it doesn't show up in battery usage, no drain or whatsoever for me on Android Pie. |
True! That's a really cool solution to avoid GCM/FCM thanks for sharing! Looks kinda like ownpush that we've talked to in the past, but looks like gotify started off with all of their source published 👍 Might be worth posting in community creations on forum. Though be sure to point out its for Android only :) I'm sure others would find this really cool |
For sure that's cool ! |
It’s not that we can’t. But imagine if all of your apps did this. Your battery would be toast. If you have just one service like fcm or gotify running then it’s not bad |
Thanks for the kind words! I'm not on the forum, so you can (or please) share it for the benefit of others. If it boosts you community points, karma or whatever, it's a free gift :D |
You're right.
I remember some kind of popup with Riot that ask me if I want to "toast my battery or not". Matrix uses FCM or long-polling in my memories. |
Wow, it would be great to have a switch in the app that we only need to flick, and it uses websockets then without any gateway or so. If you don't want the app to be killed by Android, we could just remove it from battery optimizatin just as I did with Gotify. RocketChat can be selfhosted, why use another service when we have everything we need in place? In this context, the whole gateway idea seems like a workaround. I highly support the built-in "alternative" notification idea, it can have a benefit on the privacy side as well (before Gotify, I used to turn off displaying message content for messages going through the official gateway and FCM). |
I need gateway‘s standard, it is there? |
@teko44 We had used a push notifications gateway called: Cloud Alert Messaging Gateway. The Gateway is free to download and they also have a free plan where you can send Unlimited free messages for upto 500 unique devices per month. |
I don't think there is any documentation out there, but you could either watch the packages, or look into the code or Rocketchat or one of the community wirtten gateways mentioned here like: |
Please - this Issue is closed. Read he documentation here: https://rocket.chat/docs/administrator-guides/notifications/push-notifications/ Ask questions in the forums or open.rocket.chat |
Wait, is there any way we can change this gateway? http://prntscr.com/ptih0c |
Please read my previous comment. Stop asking here as you will get no help here. Ask questions in the forums or open.rocket.chat |
i want to host my own push notification gateway ?
i dont know from where to start or what gateway to selfhost
any help ???
The text was updated successfully, but these errors were encountered: