-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Android): Adding full screen intent support #2112
base: dev
Are you sure you want to change the base?
feat(Android): Adding full screen intent support #2112
Conversation
Its working as per the mentioned expectations on oxygen OS(Android 11). |
@hariks789 I'm waiting for @Dallas62 to review this PR. |
@mateyFromTheBlock Update after testing this on Xiaomi Redmi Note 3 ( Android 6.0.1), Full-screen Intent was not working on the lock screen.
|
@hariks789 Thanks for the feedback, will validate and update PR accordingly. |
@hariks789 I've tested it on Android 6.0 and it failed to turn on the screen, so I added the flags as you mentioned and its working but only when the app is in the background before turning the screen off.
Do you experience the same behavior? |
…nt to the example app
…m/mateyFromTheBlock/react-native-push-notification into adding-full-screen-intent-support
…nt to the example app
This works like a charm, what an excellent contribution! |
Hey, @mateyFromTheBlock I didn't test that scenario, will test with these changes and post the update. Apart from this, I found another issue, having the FLAG_SHOW_WHEN_LOCKED or setShowWhenLocked(true); The only solution I could find so far is to have a separate activity to handle lock screen UI with FLAG_SHOW_WHEN_LOCKED flags and mainactivity without FLAG_SHOW_WHEN_LOCKED flag. I haven't implemented that, I am looking other options as this is complex. Let me know your thoughts |
Hey @hariks789, one solution I can think of to the issue you presented could be to create a dedicated screen to navigate to once we are showing a full screen intent and from that screen we can disable the navigation in such a way that the user could not browse the app which means the user will be "stuck" on that screen. |
Hi, Just find out that Notifee is now free and open-source. I will not have time to maintain this kind of behaviour. If you want to be a part of maintainers, feel free to ask. Regards |
@mateyFromTheBlock excellent job. But I'm confused how do I show the custom full screen when notification arrive? |
Adding support for full screen intent, for high priority notifications such as incoming phone call or alarm clock.
For more elaborate description on the uses of full screen intents you can view the following links.
https://developer.android.com/training/notify-user/time-sensitive
https://developer.android.com/reference/android/app/Notification.Builder#setFullScreenIntent(android.app.PendingIntent,%20boolean)
Motivation:
Allowing the app to launch and display an activity when device is locked.
Expected behavior:
When the user is using the device the notification will be displayed persistently (will not get "minimized" after a few seconds).
When the device is locked the app will be launched and device will get unlocked.
How to test:
After making the requested changes according to the instructions in the README file you can test it in two cases.