I'm working on a old Android native app (java) and i have to do the following: send a notification asking the user to sync the app after 24 hour from the last sync.
I can't use push notifications, so I have to make the device check locally the time of the last sync and notify the user if 24 hours have passed, but even if the app is closed.
Its like a alarm, but the notification should be a "regular notification", of course.
Is this possible? And what is the best way to do it?
Are you looking for doing this directly from the app ? If not we achieved a similar thing using a spring boot server that connect to the fire base and #schedule annotation.
I have same problem. you can use alarmManager with pendingIntent to push notif and use BroadcastReciver. when Notification push , BroadcastReciver start and you can push notif in BroadcastReciver for next day.
its easiest way.
Related
I'm making a push notification service using OneSignal API, the problem I stuck at is following : Notification is being received perfectly, but it doesn't wake up my android phone. As i searched in documentation, for IOS, you need to pass content_available : true, to wake it up, but what for Android? Are there something else i need to pass, to wake it up? Using nodejs and express as server. Thanks for answers :)
I have a usecase to be Implemented where I need to send Push Notification from my server which is implemented in SpringBoot.
In my case User will set a date reminder date (from mobile Application which is developed in React Native) which will be saved in my database mysql.
Now I need to check those dates (On server)and send a push notification to the users on that date.
what my guess is I need to continuously check for the reminder date for every user and if reminder date is equals to todays date then send the push notification.
But this approach I don't feel it's good.
Can anyone help me out what should be the architecture for my usecase.
If the app is generating the time the notification should fire, then don't have the server send a push notification. Use a local notification instead.
You can still send something to your server so that it knows a local notification was scheduled if that is data that you will either want or need to do something with, but why go through all the extra code to send a push notification when a local notification should work fine.
If the notification needs to contain some information from your server, I would try to setup your app to notify the server that a notification needs to be setup, request whatever information it will need to show, and then when the request comes back setup a local notification with the proper information.
I think there are even ways to have silent notifications that could fire and grab data from the server and then schedule an immediate local notification to show time sensitive information - assuming you can't request the appropriate information earlier.
I am facing issue in my app regarding doze mode. I am making a chat application and when app is in backgroud during doze mode and receive any message . Device does not show notification in orea.
I have followed the proper procedure for OREO notification by building channel for it.
I need to find if there is a way to whiteList my app from doze mode so that I can have notifications. Or any other process to optimize notification building.
I do not need to whitelist my application to get notifications in doze mode. I recommend to look at your notification to see if you can find the issue there.
Some tips:
Send a notification, use the notification field. If theres no notification field it will be handled as a data notification. Data notifications are delivered when the app starts again.
Set priority to high.
Maybe use time to live = 0. That will make firebase to try harder to get it delivered. But it will be lost if it fails.
Hard to give you more direct advice when I do not know where you are sending the notification from.
https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages
I want to schedule automatic push notifications trough Firebase for my Android App. I have already searched the documentation, but could not find a way to do this.
click on Send Later Button, then you can set the time for your Notification
You can do this through the Firebase Console. Go to the notifications tab and schedule a push notification.
If you want push notifications to be sent out periodically, you can set up a cron job in Firebase Functions.
i create an application on my android device and i want run it when i receive a pushover notification. After i want passing the notification's text to my app. Is it possible?
thanks a lot
You make an application which subscribes to the notifications using
NotificationListenerService in Android 4.3 or Accessiblity Events in older versions of Android. See the following SO Answer for more information.
Also see the following example.
Then in either onNotificationPosted or onAccessibilityEvent your application should triggger your other application to launch using the method described in this SO answer.
This would allow you to start an application when any status bar notification was received from PushOver, and by filtering it to only notifications related to a new pushover notification, you would start an application when a new pushover notification was received.
In order to have the notifications text passed to your application or to filter based on the specific contents of the notification, you would need to subscribe to C2DM pushover messages which is protected by signature level protection, so without consulting the creators of pushover I don't believe that is possible.