Skip to content

Notification is NOT displayed on the Notification Bar when App is on the foreground - Android #651

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

Closed
Bilal-Abdeen opened this issue Jul 29, 2020 · 1 comment

Comments

@Bilal-Abdeen
Copy link
Contributor

Your effort and time to help are highly appreciated.

Scenario 1 (Problem):

  • application is on the screen
  • the notification icon does NOT appear at all on the "Notification Bar"
  • the event registerNotificationReceivedForeground is fired correctly
  • obviously, I cannot open the notification because there is nothing on the screen to click on.

Scenario 2 (OK):

  • application is on the screen
  • I click the Home button, so the application disappears from the screen
  • the notification icon does appear CORRECTLY on the "Notification Bar"
  • the event registerNotificationReceivedForeground is fired correctly (NOT registerNotificationReceivedBackground)
  • the event registerNotificationOpened is fired correctly

I tried adding some sections to AndroidManifest.xml as described in the following post. However, this did NOT seem to work. Your effort and time to help are highly appreciated.
https://stackoverflow.com/questions/61319384/react-native-android-detect-tap-on-a-notification

Version numbers for some of the libraries used:

"react-native": "0.63.2",
"react-native-notifications": "^3.3.0",

"@react-native-firebase/app": "^8.2.0",
"@react-native-firebase/auth": "^8.2.0",
"@react-native-firebase/firestore": "^7.4.3",
"@react-native-firebase/functions": "^7.2.2",

AndroidManifest.xml:

<manifest 
	xmlns:android="http://schemas.android.com/apk/res/android"
  	package="com.casualjob">
	<uses-permission android:name="android.permission.INTERNET" />
	<uses-permission android:name="android.permission.READ_CONTACTS" />
	<uses-permission android:name="android.permission.READ_PROFILE" />

	<application
		android:name=".MainApplication"
		android:label="@string/app_name"
		android:icon="@mipmap/ic_launcher"
		android:roundIcon="@mipmap/ic_launcher_round"
		android:allowBackup="false"
		android:theme="@style/AppTheme">
		<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
		<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>

		<activity
		  	android:name=".MainActivity"
		  	android:label="@string/app_name"
		  	android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
		  	android:launchMode="singleTask"
		  	android:windowSoftInputMode="adjustResize">	
		  	<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />
		  	</intent-filter>
	
		  	<intent-filter>
				<action android:name="android.intent.action.VIEW" />
				<category android:name="android.intent.category.DEFAULT" />
				<category android:name="android.intent.category.BROWSABLE" />            
				<data android:scheme="casualjob" />
		  	</intent-filter>	
		</activity>
	</application>
</manifest>
@Bilal-Abdeen Bilal-Abdeen changed the title Notification is NOT displayed on the Notification Bar when App is on the foreground Notification is NOT displayed on the Notification Bar when App is on the foreground - Android Jul 29, 2020
@Bilal-Abdeen
Copy link
Contributor Author

Actually, I found the solution in another issue #525. Sorry, I could not understand the resolution, which was suggested in that issue, before creating this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant