I am using push api from OneSignal.com to send notifications. It's working perfectly but I want to receive notifications only if app is Active. If app is closed or not active then Onsignal notifications should be stopped.
Is this possible with this service?
I'll really appreciate for any contribution.
Thanks
You does not send push notification on active user however you have send notification using creating segment with adding filter last session time.
Related
I'm an iOS developer and this behavior is natural in iOS. If the app is in foreground and there's push notification for the app, the app will receive the push notification content instead of the OS create push notification in the notification center. Now I want to help my fellow Android developer to do the same, but we don't know where to look. As far as he knows, Android app will never receive push notification unless the user tap on the push notification, even if the app is in foreground. We need this so we can refresh the chat screen when we receive push notification from the server that a new chat message is coming. Can this behavior emulated in Android? All this time, the way he retrieved new chat message is that every 5 seconds he queries the server for new messages.
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 using Quickblox in my app, but I have an issue with the push notifications.
I receive the notifications while the app is in the background or close.
But while I have the app opened if I receive a message from a conversation I don't receive any push notification.
I use QBMessageListener when the user is inside the conversation, and it works, but I don't know how to receive messages from other conversations to show a notification to the user.
I supposed I would receive a push notifications, but it doesn't work.
Is there way a user can send a push notification when button clicked like push notification but from inside the application? . I tried to use local notifications but the notification is sent only to the user device and not to all the devices the app is installed on.
Thanks a lot.
It depends on your server, write addition Api that trigger push notification.
Hi i wish to implement push notification in my own android application. how can i do? please give me some ideas....
This kind of broadcast receivers should receive messages even if my app is closed(like Gmail.here i receive one new message in my inbox means that time the notification message is displayed on top of my android device,clicked that notification message means directly go to inbox and view that message).
here i wish to insert one data on my database means the notification message is display on my android app even my app is closed.
Please see http://developer.android.com/guide/google/gcm/index.html. You need to implement GCM.
EDIT:
To get notification even if app is in background, see Android GCM (push notification): device doesn't receive notification if application is stopped.
See Android GCM basic implementation, http://developer.android.com/guide/google/gcm/demo.html & How to setup Google Cloud Messaging for Android?
see http://developer.android.com/guide/google/gcm/index.html for detaily. There you find a tutorial and all the basic stuff