Flutter_local_notifications: Full screen notification

Created on 1 Jun 2020  Â·  22Comments  Â·  Source: MaikuB/flutter_local_notifications

Please consider working for Full screen notification (Full screen intent in android) works in Android

Most helpful comment

I submitted a PR for fullscreen notification when device is locked in Android, In the meantime feel free to check my forked project https://github.com/klitzouille/flutter_local_notifications

Just add "fullscreen: true" in AndroidNotificationDetails constructor.

All 22 comments

Not something I'm looking to work on. If you need it then submit a PR

I submitted a PR for fullscreen notification when device is locked in Android, In the meantime feel free to check my forked project https://github.com/klitzouille/flutter_local_notifications

Just add "fullscreen: true" in AndroidNotificationDetails constructor.

Note that it seems it's only working when the onSelectNotification callback opens app with runApp. I can't get it to work with Navigator.push

Hey @klitzouille, any progress on this one?
could I help in any way? I'm also looking to to have this functionality.
Should I just fork my own branch?

@MaikuB any ideas?

I don't monitor forks done by others so don't know where @klitzouille got up to so you're probably best that you fork

@nadavfima sorry I haven't had much time to work on this since the deconfinement. My fork is working for fullscreen notifications, but I can't get the tests working, so I can't submit the PR.

Apologies for the delay but I just pushed out the 1.5.0-beta.7 release that includes the changes done by @nadavfima to support full-screen notifications

It does not seem to work. When we try this, the push notification brings the app to the front. That is not what I this the "Full Screen Intent" should be.

It should be a push notification that is full screen (not simply bring the app forward)

That is not what I this the "Full Screen Intent" should be.

Is this based on what you thought the functionality would do or how the native Android APIs actually behave?
If you look at the full-screen intent (e.g. read https://developer.android.com/training/notify-user/time-sensitive#create-high-priority-notification), it specifies what activity is meant to be shown. For a Flutter application, there's only one activity so that means the application is brought forward and it will up to the app to decide what needs to be shown.

Well, that is not exactly what I am looking for.

If I look at the source code from the link you use, my understanding is that in native, I can get a specific activity and call .setFullScreenIntent(fullScreenPendingIntent, true).

As the documentation points out 'full-screen intent only for the highest-priority alerts where you have an associated activity that you would like to launch after the user interacts with the notification'

Therefore, bring the app forward is good, but my expectation is that I can set which screen to show when that happens, but currently it just shows whatever the current screen is.

On the other word, if what I would like to achieve is not what this package can do, then it is fine. Do you have any suggestions that might achieve that?

An obvious example, I am using Whatsapp and it is currently in a chat screen. I lock my screen and leave it for now.

Getting a call through Whatsapp. It shows a phone call page full screen.

But, if it only brings the app forward, then it shows the current chat screen, which is not what I would expect.

I think you are talking about VoiP service. That is different.

On Fri, 28 Aug 2020 at 10:06, Shane Zheng notifications@github.com wrote:

An obvious example, I am using Whatsapp and it is currently in a chat
screen. I lock my screen and leave it for now.

Getting a call through Whatsapp. It shows a phone call page full screen.

But, if it only brings the app forward, then it shows the current chat
screen, which is not what I would expect.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/MaikuB/flutter_local_notifications/issues/651#issuecomment-682319893,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIILKESQGWWZQNL6Y3Q7L3LSC4X6RANCNFSM4NPR42WA
.

--
With Regards,

Savad M V

@ShaneZhengNZ

If I look at the source code from the link you use, my understanding is that in native, I can get a specific activity and call .setFullScreenIntent(fullScreenPendingIntent, true).

As the documentation points out 'full-screen intent only for the highest-priority alerts where you have an associated activity that you would like to launch after the user interacts with the notification'

I'm not sure what you're trying to point out here as it this seems to contradict more on what you wrote in how it should be a "push notification that is full screen"

Therefore, bring the app forward is good, but my expectation is that I can set which screen to show when that happens, but currently it just shows whatever the current screen is.

Is this based on what you see happening with the example app? If not, can you let me know what happens for you when you run the example app, tap on the button for showing full-screen intent and follow the instructions there?

Is this based on what you see happening with the example app? If not, can you let me know what happens for you when you run the example app, tap on the button for showing full-screen intent and follow the instructions there?

we had an app written in Xamarin. What it does is exactly what the full-screen intent documentation says. When a specific notification is received, a specific page/view/activity is set as the full-screen intent, which is shown full-screen. I can then click on that to interact with the app.

If you read the original time-sensitive notification, it says:
Display time-sensitive notifications
In specific situations, your app might need to get the user's attention urgently, such as an ongoing alarm or incoming call. You might have previously configured your app for this purpose by launching an activity while your app was in the background.

From here, it is very clear that it is an intent (activity) that should be made fullscreen.

You could also refer to fullScreenIntent android documentation -
https://developer.android.com/reference/android/app/Notification#fullScreenIntent

It says - An intent to launch instead of posting the notification to the status bar.

@ShaneZhengNZ I know what the docs say but you still haven't answered the questions that you've quoted, particularly on what you see happening when you run the example app

@ShaneZhengNZ I know what the docs say but you still haven't answered the questions that you've quoted, particularly on what you see happening when you run the example app

When the phone receives the push notification, it shows a notification page, which is full-screen. The key here is that this is a specific notification shown in full-screen. not the app brought forward (because in the case of the app brought forward, the screen is not the specific notification that I want).

@ShaneZhengNZ your response reads like you're describing what you expect to happen again when I'm asking you to describe what happens when you run the example app for this plugin. Could you please do so, include a recording if possible and then describe how it's not working as expected.

Edit: in case you don't know where the example app is, it's https://github.com/MaikuB/flutter_local_notifications/tree/time_zone_macos_support/flutter_local_notifications/example but best to download/clone the repo

I tried the package with my own app that we are working on at the moment. It only brings the app forward when we set fullScreenIntent to true.

What I am saying is that this does not align with what Android time-sensitive notifications / Full-screen intent is described in the Android documentation.

Please get back to me after you run the example app then

Edit: to repeat I know what the docs say but as I mentioned earlier, Flutter applications only have a single activity. I'm assuming your Xamarin app was a Xamarin.Android app as Xamarin.Forms applications only have a single activity as well. The reason for getting you to run the example is it should do a bit more than bring the app forward

well ok, the confusion is that we are using Firebase to send a push notification to the app. I thought this package is capable to display that full-screen.

Assuming that the issue is resolved

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hsalazarl picture hsalazarl  Â·  6Comments

carlleeswanson picture carlleeswanson  Â·  8Comments

salah-rashad picture salah-rashad  Â·  3Comments

Abdelkrim picture Abdelkrim  Â·  8Comments

CedYF picture CedYF  Â·  6Comments