Android direct reply in notification when app is in background? - android

I created my Direct Reply in onMessageReceived(), and it works fine, when the app is in the foreground.
How can I use Direct Reply in push notification, when app is in the background?
I found a similar question, but no correct answer.
Is it even possible?

Related

Firebase push notification is not working properly when device is offline

I am implement a tap action on the notification and then i found out that when i am offline and triggering the notification. and when i am coming to online i am only receiving the last notification. and it is only happening in android
please help
I have read lot of solution but did not found any proper answer.
I assume you've read this then. Check notification's time to live first, and if you're sure that's not the cause, make sure you're using different notification ids for notifications, otherwise you'll replace the currently shown notification with a new one.
Answered a similar post here. This is working as intended as notification messages are always collapsible.

Open an app which is not in background using FCM

My project is based on jitsi meet for android. I'm planning to go with react-native and firebase. The requirement is if one person calls the other person they will receive a call screen with ringtone. How can I achieve this if the app is not running in background?
This is a very tricky solution that you're trying to implement, especially it's working will vary a lot when it comes to deploying the application on Chinese OEM apps.
The process that you could instead follow is, Listen for FCM notifications along with that attach a payload to validate what kind of push notification is it. Based on that if it's a push notification for an incoming call, you can launch a foreground service which will allow your app to stay active and at the same time use a custom Broadcast Receiver. The Broadcast Receiver will receiver a trigger from your FCM Service and that will be used to open an activity that has your call screen UI.
Feel free to connect for a any help needed.
Using FCM, if there's a push notification, app automatically opens even if its not in background. But i believe you need to pass url on click of push notification of which triggers Deeplinking to actually trigger that page when the app opens, so directly it would navigate to the jitsi call page.
Check this link rn - deep link
Hope it helps. feel free for doubts

Android Cancel Notification From Backend

I noticed that some app like messenger clear their notification in phone even I viewed the message from web.I know it can be done by giving ID to notification when showing it and when it needs to be cleared we can send another event via FCM and clear the corresponding notification. Is there a proper way of doing it other than sending another event via FCM because it feels not the proper way of doing it for me.
I hope it will helpful Can you expire / remove a message remotely on FCM?.
Note: due to low reputation I had to use answer section instead of comments.

Push notification after onDestroy

I have learnt how to send a push notification, it works well but I need to send a notification to the user even after the app has been closed. So far I know how to send it while the application is running. How do you send a notification when app is in the background or when its even closed, on Android?
There are many answers to this, you could use a Service in background and through that you could do, that service would be running at all times.
If you want your notification to be popped up at some specific point of time, you can specifically use BROADCAST RECEIVER. And with the help of PENDING INTENT, you can easily achieve this task.
About all the above keywords stated, you can easily find in the documentation of Android online.
Hoping that I was helpful...
In case of any more queries... Do ask and clarify.
Thank you...

Air iOS/Android push notification remember when app launches

I have an app built for iOS and Android which has push notifications. Everything is working great however I was wondering if there is a way to store the data of the push notification in the app so that when users launch the app after receiving a notification I can show them the message again?
Basically I allow users to share information and/or chat amongst their friends. If they receive a notification when the app is in the background it comes through as a normal push message but when they launch the app I would like to direct them to the chat feature to see the message again.
I am storing the messages sent in a remote DB but seeing as they have already received the payload it doesn't make much sense for the app to call the remote DB to retrieve the same message.
I am using Distriqt's extensions in AS3 and Air 3.5.
Cheers
I asked Distriqt's support for the same thing a few weeks ago and they explained that there is no way to get the information of the push notification message while the app is closed so they suggested this :
- when the user opens the app, you call your server to check if they haven't missed anything, and get the data from there. If there has been a push, you display the push message as if it was received with the app in the foreground.
It's a bit tricky and not very satisfying but it works.. As long as the user follows the path.
If your user receives the push and chooses not to open your app, he will still get the push message in your app next time he opens it.
I was having trouble figuring this out too but I found a solution! Basically if a user launches an app (not running in the background) by way of a notification it comes through in the Invoke event, not the usual Notification event. So do this:
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, invoked);
private function invoked(evt:InvokeEvent):void
{
if (evt.reason == InvokeEventReason.NOTIFICATION)
{
var payload:Object = Object(evt.arguments[0]);
// do stuff
}
}
That's pretty much it. There's more detail in this blog post here: http://blogs.adobe.com/airodynamics/2012/05/29/push-notifications-support-in-ios/
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, invoked);
doesn't work correctly for Android push notification. Android starts with InvokeEventReason.standard all the time, so we cant receive message. It works only for iOS.

Categories

Resources