Firebase Push Notification Android when application is closed - android

I'm developing an application dealing with push notifications. I have used firebase for this purpose. The requirement is as such on clicking notification , the 3rd activity of the application must open up . I was successful in achieving the same when application is in background and foreground . But when application is killed and on tap of the received notification , it takes me to launcher screen . what should i do to redirect a notification click to the activity i want when the application is killed ?

Related

notification click event, best way to show activity data from service while app is closed android

i have made an app where i made a unbound service that is continuously requesting to server api, if server send json then notification will show and on notification click i take the user to one activity to show some data. everything working well while apps is opened or background. but when the app is closed, notification showing but when on notification click trigger to specific activity, there is no data showing(data should come through a server req).
what is the best way to do this?

Android - Handle local notification when app in foreground

My app receives FCM and fires local notifications, which open target activities. This works fine if the local notification is clicked when the app is not running.
But, if the local notification is clicked when my app is already running (foreground or background), I don't want to open the target activity but shows an AlertDialog first. So, the activities stack is not changed and the user can continue what he was doing before.
It seems the local notification must have an action, which opens activities. Is there anyway achieve what I wanted above?
I think you have to stop sending push notification when you app is in foreground
check if your app is in foreground or by following this link
check android application is in foreground or not?
check this in firebaseMessegingService class before sending PN and manage alert dialog appearance according that

OneSignal Push Notification Failed when user kill the application

I have implemented push notification with OneSingal APIs in my android project. I'm facing an issue while clicking the push notification, that i was unable to launch the specified screen when the user click the push notification, If the user kill the app from background(long press and remove the pplication from list of apps). I have registered the Open/Receiver handlers in application class. Seems like, the handlers are no more visible in the app, when user kill/remove the app from background.
Please help me to resolve the issue.
Unfortunately Android apps are not able to receive notifications when they have been force-closed. This is part of the design of the Android OS.

Push Notifications Android. Application not running clarificaiton

I'm developing an android app which implements push notifications using parse.
I have a requirement that the app must 'still receive notifications if the app is not running', but what is 'not running' on android? from what I gather there are 3 ways in which an app can 'not run'.
using the back button when the app is running
going to applications->force quit
holding down the back button and clearing the app from the list of recent apps
using the home button.
I have a broadcast receiver registered through manifest that fires only if the app has been closed using methods 1. and 4.
Is that how it should work on android? or should my broadcast receiver trigger no matter how the app is closed?
It's the normal behavior, take a look at the doc here :
http://developer.android.com/about/versions/android-3.1.html
Section Launch controls on stopped applications
Or here :
http://www.javacodegeeks.com/2012/05/android-broadcast-receiver-change-in.html

Not show notification in status bar if app is running

I am implementing an android app that uses a service which posts notifications. I only want to display the notifications after the user has closed the app. Is it possible to not show notification in status bar if app is running?
You can work it around:
You could notify your service when the app has started (from the app), so it can remove the Notification instance.
The same, when your application has been closed by the user, before explicitly finishing the current activity, the app will notify the service to show the notification again.

Categories

Resources