Closed aalindQuantel closed 1 year ago
Hello, @aalindQuantel 👋. When you say "no pop up is coming up", do you mean that the notifications center (usually in upper left) has nothing showing up in it (e.g. nothing when you swipe down/expand it the notification drawer)? The default settings for channel importance will send push notifications to the notification center without showing a heads up notification (pop up), and will not display when triggered in foreground.
So if I'm understanding your description about Notifications.Push.onNotificationReceivedInForeground()
not triggering a pop up notification, that sounds like expected behavior. Can you confirm if the docs and descriptions above align with what you're seeing?
@cwomack yes the banner part is missing , notifications are coming up alert tone is there but banner is not showing how can i config that
@aalindQuantel, if your app is active in foreground then the banner is not going to be displayed.
While your app is active in the foreground, all message types are handled through code and not by the notification center. On Android, you can intercept that and then create a notification to force something to display... but we currently don't support anything like that.
Since you can't create a notification directly from React Native, if you're wanting that behavior of displaying notifications (even while app is in foreground), you could potentially go into native Android code and add in that functionality.
@aalindQuantel I wanted to follow up and verify if you were referring to only foreground or were you talking about Push Notifications not showing up as described above at all (foreground, background, etc.)?
@cwomack, I wanted to let you know that everything is functioning properly now. I understand that notifications are not displayed visibly while the app is active. However, I have one remaining issue: when the app is in the background or terminated state, the banner does not appear by default. I have to manually go to the settings to enable it. Is there a way to accomplish this through code during the configuration process?
Hi @aalindQuantel
Is there a way to accomplish this through code during the configuration process?
At this time this is not yet configurable. This is configured via channel management on Android and, as of this time, not something Amplify can support. It is something we are aware of and are evaluating for our roadmap, however, and I welcome you to open a feature request around this.
@aalindQuantel, I'll close this issue for now due to the confirmations above that the behavior you're describing is expected. We'd welcome you to open up a feature request (link here) detailing the improvements you'd like to see for Push Notifications.
If you do, please drop a link to the feature request in another comment here or just reference this issue in the feature request. Thank you!
@cwomack, I wanted to let you know that everything is functioning properly now. I understand that notifications are not displayed visibly while the app is active. However, I have one remaining issue: when the app is in the background or terminated state, the banner does not appear by default. I have to manually go to the settings to enable it. Is there a way to accomplish this through code during the configuration process?
I am the same. Also, the banner is not showing on devices or emulators below Android 13. I also tested it on a clean react native project, but it's the same. Below 13, there is no option in system settings to set whether the banner should appear or not.
My env:
System:
OS: macOS 13.4.1
CPU: (8) arm64 Apple M1 Pro
Memory: 57.52 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.1 - /usr/local/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 10.1.0 - /opt/homebrew/bin/npm
Watchman: 2023.09.04.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 117.0.5938.149
Safari: 16.5.2
npmPackages:
@aws-amplify/rtn-push-notification: ^1.1.7 => 1.1.7
@babel/core: ^7.20.0 => 7.22.17
@babel/preset-env: ^7.20.0 => 7.22.15
@babel/runtime: ^7.20.0 => 7.22.15
@react-native-async-storage/async-storage: ^1.19.3 => 1.19.3
@react-native-community/netinfo: ^9.4.1 => 9.4.1
@react-native/eslint-config: ^0.72.2 => 0.72.2
@react-native/metro-config: ^0.72.11 => 0.72.11
@tsconfig/react-native: ^3.0.0 => 3.0.2
@types/react: ^18.0.24 => 18.2.21
@types/react-test-renderer: ^18.0.0 => 18.0.1
HelloWorld: 0.0.1
amazon-cognito-identity-js: ^6.3.6 => 6.3.6
amazon-cognito-identity-js/internals: undefined ()
aws-amplify: ^5.3.11 => 5.3.11
babel-jest: ^29.2.1 => 29.7.0
eslint: ^8.19.0 => 8.49.0
jest: ^29.2.1 => 29.7.0
metro-config: ^0.79.1 => 0.79.1 (0.76.7, 0.76.8)
metro-react-native-babel-preset: 0.76.8 => 0.76.8 (0.76.7)
prettier: ^2.4.1 => 2.8.8
react: 18.2.0 => 18.2.0
react-native: 0.72.4 => 0.72.4
react-native-get-random-values: ^1.9.0 => 1.9.0
react-native-url-polyfill: ^2.0.0 => 2.0.0 (1.3.0)
react-test-renderer: 18.2.0 => 18.2.0
typescript: 4.8.4 => 4.8.4
npmGlobalPackages:
@aws-amplify/cli: 12.6.0
eslint: 8.27.0
n: 9.1.0
node-gyp: 9.1.0
npm: 10.1.0
yarn: 1.22.19
This is pretty basic requirement, isnt it?
What is the ETA?
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Push Notifications
Amplify Categories
notifications, interactions
Environment information
Describe the bug
I am using aws-amplify version 5.0.14 and @aws-amplify/rtn-push-notification version 1.1.1 , everything is set up and i am able to see notification data of Notifications.Push.onNotificationReceivedInForeground on console also the permissions are enabled too, but no pop up is coming up
Expected behavior
When Notifications.Push.onNotificationReceivedInForeground is triggered i should get a pop up of the notification also be displayed.
Reproduction steps
AndroidManifest.txt MainApplication.txt MainActivity.txt
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
Emulator
Mobile Operating System
Android 13 (sdk 33)
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response