Comments (7)
The ntfy Android app typically keeps a persistent connection open to the ntfy server using a background process/service. If that persistent connection fails (and the app was installed from the Play Store and not from F-Droid), ntfy will fallback to receiving notifications via FCM, which does work in the background, like you said.
All of the Android code is open-source, so you can look at it directly to see how things work. https://github.com/binwiederhier/ntfy-android It is in Kotlin, though, not Flutter/Dart.
UnifiedPush is cool because it lets your app receive notifications through ntfy's persistent connection. So you don't need to worry about setting up any sort of persistent network connection with graceful FCM back up. As long as ntfy is installed on the same device as your app, your app can benefit from ntfy's persistent connection. In your app, I believe all you need to do is set up a BroadcastReceiver that listens for UnifiedPush messages.
This describes UnifiedPush more and includes a Flutter example: https://unifiedpush.org/developers/flutter/
from ntfy.
I don't know for sure. I haven't used FCM very much. But I'm pretty sure you can use whatever you want. Since you're building the app, you get to decide how notifications and subscriptions work. I believe ntfy is set up to subscribe to a FCM topic that's the same as the ntfy topic, though
from ntfy.
When you close the app, it's closing the connection to the ntfy server. You'll probably want to look into and implement UnifiedPush. Or you'll need to implement something else to keep a connection to the server open in the background
from ntfy.
Yeah! I know Firebase has a background function to workwith background notification using FCM.
But how does the ntfy.sh android app can do this. if they can do it there will be a way,,,
if the app is closed still the notification is coming in this app when a new message is send to that topic
from ntfy.
Thanks for the insight. I will check on the resources
from ntfy.
@wunter8 hey I tried to implement it with FCM. I stuck where I need to subscribe to a topic in FCM to receive notifications in the background .
I tried the same topic as my nfty topic but I think that's not it.
do you tend to know what will be the server topic for my specific nfty topic (eg. mytopic in ntfy.sh)?
from ntfy.
thanks
from ntfy.
Related Issues (20)
- Add Checkmk to the list of applications supporting ntfy.sh
- Minimum priority on web app won't work when Background notifications enabled
- iOS not pushing notifications. Iphone12 Version 15.3.1 HOT 1
- Accentuated chars in the title header aren't supported HOT 1
- Add 'everyone'-like user for all authenticated users HOT 1
- Lemmy link is broken?
- Minimal server footprint
- Matrix push gateway doesn't send/receive notification from the clients in SchildiChat: Self-hosting, reverse proxy, unix-socket
- Zombie process created every minute HOT 4
- Per-Topic Notfiication Sounds in the Web App
- iOS Label for Subscribed Topics
- Feature request: Add "click" as intent extra
- Expose TLS config options
- Authentication issue - 40301 "Error publishing notification" HOT 2
- Is another webserve needed for pushing attachments outside ntfy UI? HOT 3
- horizontal rule incorrectly parsed in web ui
- Rationale for current topic name's allowed characters and size ?
- The low priority message shoud not have a sound HOT 1
- Attached file for automation in Android gui client
- Android app: Irrelevant or unknown message. Discarding.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ntfy.