I am making a app that is checking if there is new posts and threads on a forum page like reddit. The app is notifying the user when there is a new post, with background fetch, but if the user closes the app, the background fetch doesn't work. Also, the app isn't updating exactly every hour, but maybe just every 5-10 hour. Is there another way of updating in the background, like sending remote notification, and if, how?
The only sensible way would to leverage silent push notifications.
Silent notifications do not show up for the users, but they do wake up the app.
It's very easy to send a silent push. More here...
Related
When the App in background I handling notification data in the _handler.
FirebaseMessaging.onMessageOpenedApp.listen(_handler);
It's working good.
On notification click the App start and need to get the notification data.
How do I inform the App?
I'm trying with shared_preferences but its working with delay
I know the reply is a bit late, but maybe it's helpful for someone else.
For me it works using the handler. It's described in the documentation at https://firebase.google.com/docs/cloud-messaging/flutter/receive
Check the chapter "Handling interaction".
Using that example I can pass notification data in the app, as soon as it is started via a received notification.
Is there a way to store app notifications in a flutter app. Most of the time this app will be closed and the app notifications will not directly be hitting the app. I would like to store app notifications in a notifications received section. I know I can get the notifications if the app is opened, but for if the app is closed and it just shows as a status, I can't get them in the device unless the user clicks on the notification message. and it opens the app. What options do I have and is what I am wanting to do even possible?
First interpretation of your question: If I read your question correctly, you're saying its not possible to have text in your notifications when the app is not open. This is definitely possible, almost all your apps create notifications on the device with more than just 'status'.
Another interpretation of your question: In response to a firebase cloud messaging message, you might want to save data or do some other background task, instead of just creating a notification the user sees. This is not enabled by default. There's lots more instructions on enabling and using this in the README
By default background messaging is not enabled. To handle messages in the background:
The golden nugget of information is _firebaseMessaging.configure(onBackgroundMessage: yourBackgroundMessageHandler) which is not listed under the receiving messages section.
Let me know if I misread. What do you mean by status?
You can use background Fetch to make the app stay in the background. The package will awaken an app in the background about every 15 minutes.
I am using phonegap push notification plugin and all seems work fine. push comes without any problem.
But the problem is there is nothing I can do when app is back-grounded.
multiple push notifications can arrive when app is backgrounded. I can not expect which push
notification user going to click. Whatever notification user clicks, app will be resumed without
information of user selection. I have to trigger different events depanding on what nofitication
user selected. I need to know what notification user selected when app is resumed but don't
know how to... seems very tricky problem. is there anybody had same problem?
how did you guys handle this problem?
any help will be appriciated.
never mind...
I thought window.plugins.pushNotifiction.getPendingNotification would return all pending
notifications which arrived while app is background.
But getPendingNotification function only returns the notification that user selected on
notification center or mobile screen.
well... seems nice..
you can`t get all notification information which fire during application is off or app. is in background but, you can fetch user info shortly receive notification in native iOS app.
please follow this application:didFinishLaunchingWithOptions.
At first call of launch you can check for options and retrive the user-info.
for more info refer above link.
I have a simple application that shows some videos from a YouTube channel. I need to send a notification to my users when that YouTube channel have a new video.
I've been thinking and I realize that if I use local notifications the app will have to run a method every "5 minutes" and check if there's a new video, BUT when the user closes the app my method will stop running and the app will stop checking for new videos.
Otherwise, I'll use remote notification. I'll store the user device token into a database and check for new videos with PHP. When it happens, I'll send a push to all my users. Unfortunately, this case will overload the server that the PHP is.
My question is: What's the best solution? Is there any way to I keep executing a method when my app is closed?
Push is your best option. There isn't a good enough way to keep checking in the background to use local notifications accurately enough. Monitor for new videos on your server as often as you feel necessary and fire a push notification to the user. That model exists in many apps across the app store. Good luck.
Hello I was wondering if there are any methods that would allow me to interact with the iphone users. What I mean is like UIALERTVIEW of some sorts that will popup and update them with a status. But I don't want to have a fixed status, but one I can change anytime I want, like say if there is a day off, I want to provide a status over the air and when the user opens the app it will show the new message.
Is this even possible?
If there are any other alternatives please list them
The easiest solution would be that your app is contacting your website and downloads any message it should show on startup.
You can use Push Notifications to send users important updates automatically.
What you are looking for are called Push Notifications. They can put small numbers on your app's icon like the email app when you have new emails, or even show you popups when you need it. Start here: https://developer.apple.com/appstore/push-notifications/index.html
you can use Push notifications .. or build your own notification system by design a function fired when your application launching to contact your website and check if there any new notification .. then you present a pop , view whatever to show the notification.