OneSignal / react-native-onesignal

React Native Library for OneSignal Push Notifications Service
Other
1.57k stars 374 forks source link

Foreground notification popup not show on screen top #1493

Closed webdeveloper510 closed 1 year ago

webdeveloper510 commented 1 year ago

What happened?

Foreground notification does not trigger when notification gets in the foreground

Steps to reproduce?

{
  "name": "ExoticIndia",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@invertase/react-native-apple-authentication": "^2.1.2",
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-async-storage/async-storage": "^1.15.4",
    "@react-native-community/checkbox": "^0.5.14",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^6.0.2",
    "@react-native-community/push-notification-ios": "^1.10.1",
    "@react-native-community/slider": "^3.0.3",
    "@react-native-firebase/analytics": "^12.8.0",
    "@react-native-firebase/app": "^12.1.0",
    "@react-native-firebase/auth": "^12.1.0",
    "@react-native-firebase/messaging": "^12.9.3",
    "@react-native-google-signin/google-signin": "^6.0.1",
    "@react-native-picker/picker": "^2.4.8",
    "@react-navigation/bottom-tabs": "^5.11.10",
    "@react-navigation/drawer": "^5.12.5",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.5",
    "@types/react": "^17.0.34",
    "@types/react-native": "^0.66.2",
    "axios": "^0.21.1",
    "card-validator": "^8.1.1",
    "expo": "^41.0.1",
    "expo-image-picker": "^10.1.4",
    "expo-linear-gradient": "^9.1.0",
    "expo-permissions-interface": "^3.0.0",
    "formik": "^2.2.6",
    "install": "^0.13.0",
    "native-base": "^2.15.2",
    "npm": "^9.4.0",
    "react": "17.0.1",
    "react-native": "0.68.2",
    "react-native-device-info": "^8.1.3",
    "react-native-fast-image": "^8.6.3",
    "react-native-fbsdk-next": "^4.3.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-htmlview": "^0.16.0",
    "react-native-image-slider-box": "^1.1.9",
    "react-native-image-zoom-viewer": "^3.0.1",
    "react-native-keychain": "^7.0.0",
    "react-native-modals": "^0.19.9",
    "react-native-month-year-picker": "^1.9.0",
    "react-native-onesignal": "^4.5.0",
    "react-native-permissions": "^3.6.1",
    "react-native-push-notification": "^8.1.1",
    "react-native-radio-buttons-group": "^2.3.0",
    "react-native-ratings": "^8.0.4",
    "react-native-raw-bottom-sheet": "^2.2.0",
    "react-native-razorpay": "^2.2.4",
    "react-native-reanimated": "^2.1.0",
    "react-native-render-html": "^6.3.0",
    "react-native-safe-area-context": "^4.2.4",
    "react-native-screens": "^3.18.2",
    "react-native-select-dropdown": "^3.2.1",
    "react-native-share": "^6.0.1",
    "react-native-swipe-list-view": "^3.2.7",
    "react-native-unimodules": "0.13.3",
    "react-native-webview": "^11.4.4",
    "rxjs": "^7.0.0",
    "yup": "^0.32.9"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "@types/react-native-push-notification": "^8.1.1",
    "babel-jest": "^26.6.3",
    "eslint": "7.14.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.64.0",
    "react-test-renderer": "17.0.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

What did you expect to happen?

I expected foreground notification pop up show on screen top

React Native OneSignal SDK version

4.5.0

Which platform(s) are affected?

Relevant log output

No response

Code of Conduct

nan-li commented 1 year ago

Hi @webdeveloper510,

Are you reporting this issue for Android?

Are you asking about Android's "Heads-up notification"?

For Android 8 and newer you will need to create a Notification Category / Channel with a high priority to make it heads up. OneSignal's dashboard has this build in, see the documentation below. https://documentation.onesignal.com/docs/android-notification-categories

nan-li commented 1 year ago

Closing due to no response