I'm developing an app in Flutter and using Firebase to send Push Notifications, the phone is receiving them but the issue is that I wan't to display a little retancle with some text inside such as WhatsApp does when you receive a new message, but mines just go for the top of the notifications bar and doesn't show anything. Does anyone know how to proceed or how is called the component that I need to implement?
Expected result:
Thank you!!
Related
This is the first time I am integrating notifications into my application. I am using Firebase. Setup was extremely simple and I am able to view the notification in the tray.
So, when the application is open, and if it receives a notification. I would like to display the notification in the activity itself.
How should I go about this?
You can look at Gmail approach. If there is new mail in current thread, they show SnackBar with notification.
You need to determinate connected parts of your app. And if notification connected to part where current user is - show SnackBar, and if there is something completely different - show heads-up notification.
Guide how to do Heads-Up notifications here
Guide how to do SnackBar notifications here
Have you ever tried Pushbots , its an infra- Structure for Notifications , it has more interesting Features than Firebase. Give it a shot.
Pushbots link
As we know, developing on Android we can handle push notification and show a custom view depending on our logic. But there is a problem, if I send a push notification with a content and title from the server android will auto-display the notification and if I handle them at the same time the phone shows both, mine and the auto-displayed.
How can I disable auto display of the notification in these cases.
Why do I need to do this?
I am using OneSignal to send push notifications for both android and ios. The second one need to receive a content and title to be shown but this is not mandatory for android and I want to be able to show a custom view in this case.
Thanks in advance
You can omit the displaying of the OneSignal notification by the SDK by setting up a NotificationExtenderService per the OneSignal Background Data and Notification Overriding documentation. Use the NotificationExtenderBareBonesExample class example shown in step 2 and return true instead of false to let the SDK know your handling the notification.
I want that my app will send data (Equation) to another android device and when the other device will get that data he will make calculation with that data (equation).
any idea's how to send data ??
Thanks.
P.s: its similar to this preview question: Send an equation to another android user for solving auto
You can use GCM. it's the Android push notification.
The notifications will arrive to the device regardless if the app is in the background or forground.
About the user noticing it, it's up you. The push notification itself is not showing anything to the user. It enters a callback (OnReceive) and you as the developer decides what to do with it. you can show an alert at the status bar, Send a broadcast to a service, update the DB or in your case do something with an equation etc...
Are you considering Bluetooth as an option?
If so, this lib may help you https://github.com/buddles/AndBT
I want from my Java server to be able to send an Android notification that will take the form of an invite. I'm currently able to send a basic Android notification, but I want to appear on the screen in form of an invite with options like 'Yes, I accept' or 'No, I refuse' and then send the answer back to the sender. How would you do something like this? I have no clue how should I do it and I can't find anything on the Internet.
Thanks,
Alex
After you receive a pushed message from server, you can launch a new Activity which has a dialog style, then you can do your business in that activity.
the case is very much the same as receiving a sms.
You can create a custom layout for your notification using RemoteViews and manage OnClick events. See Android Notifications, and this question might help you too Create Notification using some controls
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.