I'm using my application GCM push notification. I can send a message to the user via php. But I want to make a push notification can operate on its own. So in practice the day if not used, the application was not used today because you get a push message. If you send me the following hours or user himself he put option is sending messages to alert the user that hour. How do I do this?
Edited:
is can be local notification ? maybe i wrote wrong ? :)
i added this project in my app.but i need more :)
I would get the application to store the last used time somewhere, such as a database table.
Then create a PendingIntent and BroadcastReceiver to fire at the desired time. The broadcast receiver checks the last used time, and creates a standard Notification if the app was not used for that day.
Related
I want to send the "We miss you" notification to the users who haven't user my app in more than 5 days. Can this be done with Firebase notifications?
I haven't noticed any options when creating a new notification that can see if the app wasn't used or anything similar, so I'm wondering is it possible to retrieve the timestamp of when the app was last accessed and schedule a notification (maybe locally?) using the said timestamp?
You can use implement ActivityLifecycleCallbacks.To know how to implement refer -Automatically log Android lifecycle events using ActivityLifecycleCallbacks?
Once you implement ActivityLifecycleCallbacks you will get callback whenever any of the activity is interacted by the user.
You can send this timestamp to the server everytime user interacts with your app.
The server can maintain 5 min timeout logice and send a push notification to the device.
On receiving the push notification your app can show notification to the user.
I am trying to figure out how Facebook / Twitter sends push notifications like "You have 20 new followers"I don't know how to call it but i want to learn the underlying algorithm of this in Android. Please help, Thanks !
On Android you can execute your code before actually showing a push notification. They could simply send a push notification to all devices with an identifier, then the app can make a request to the server and get the needed information in order to show the push notification.
They can also send one push notification per device, as they can associate the push notification key with the user login, and the server would fire a push notification every time there is an event that demands a push notification.
But there are also other ways of doing this, for example, they can, for example run locally in background and create a local notification when the app decides it is necessary.
I am creating an app, and I want the user to be able to specify a time of day that they receive a push notification from the app based on their defined preferences. I would want to run a little bit of code at the specified time to generate the necessary information to include in the push notification.
Example: A user states that they want to receive a push notification at 7am every morning their time. At 7am their time, a snippet of code would run to check a few pieces of information. Once the information is returned, the push notification will be sent to the user and will be tailored to the previously returned information.
I want to be able to set this up so any user of the app can set up their time preference for the notification, and will receive a notification tailored to them (not one notification that is the same for everyone). I have read into GCM and Mixpanel, and am not finding a way to do this without manually enabling push notifications for each individual user myself. All help is appreciated. I am new to Android, so any constructive feedback is appreciated.
I am making an application which will send popup messages in the notification bar of the user, these messages have them send agree to a date specified weekly depending on the day, for example every Monday of each week, as I do that in android eclipse? I need besides those messages arrive so the application is closed, now I have a database in sqlite with notifications have to do weekly. Thank You
You can setup an alarm which should fire up a IntentService who in turn will fire up the notification. In the Service you can consult DB in order to decide to set a notification or not.
All this is done not in Eclipse but using Android API.
Yes, after alarm in configured, it will act despite of application running.
I have developed an app using GCM for push notification.My app using for stacking purpose so I have to receive notification like in First in First out order.But now am not getting notification from GCM in order.How to manage to receive notification in order and is possible to manage GCM server from our end.
No it's not possible in GCM server. But another way is you can Hack this Notification in your Server triggered by GCM and Run a cron at particular order.
no you cannot get the notification in first in first out order .they are randomly generated by the server.you can do this in your server connected with GCM and put them in serial order
gcm document already mention this
http://developer.android.com/google/gcm/adv.html
Note that the order of delivery is not guaranteed.
GCM order of message is not guaranteed. For this you can achieve another way.
Ask to server guys to create API(Webserver) for message, The message is same as they were earlier sending through the GCM.
After that you have to create Calender scheduler (Like Every 5 min) and then call this web-service and show notification.