You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have used this library react-native-push-notifications in my react-native-app.
whenever i schedule any notification, it does not appear(even though it is listed in the getScheduledLocalNotifications() ), PushNotification.localNotification() works fine but the PushNotification.scheduleLocalNotification() does not work even in simpler circumstances.
<manifestxmlns:android="http://schemas.android.com/apk/res/android">
<uses-permissionandroid:name="android.permission.INTERNET" />
<uses-permissionandroid:name="android.permission.VIBRATE" />
<uses-permissionandroid:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permissionandroid:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permissionandroid:name="android.permission.VIBRATE" />
<uses-permissionandroid:name="android.permission.WAKE_LOCK" />
<applicationandroid: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">
<!-- Change the value to true to enable pop-up for in foreground on receiving remote notifications (for prevent duplicating while showing local notifications set this to false) -->
<meta-dataandroid:name="com.dieam.reactnativepushnotification.notification_foreground"android:value="true"/>
<!-- Change the resource name to your App's accent color - or any other color you want -->
<meta-dataandroid:name="com.dieam.reactnativepushnotification.notification_color"android:resource="@color/white"/> <!-- or @android:color/{name} to use a standard color -->
<receiverandroid:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions"
/>
<receiverandroid:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
<receiverandroid:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver"android:exported="true"
>
<intent-filter>
<actionandroid:name="android.intent.action.BOOT_COMPLETED" />
<actionandroid:name="android.intent.action.QUICKBOOT_POWERON" />
<actionandroid:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
</intent-filter>
</receiver>
<serviceandroid:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"android:exported="false" >
<intent-filter>
<actionandroid:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<activityandroid:name=".MainActivity"android:label="@string/app_name"android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"android:launchMode="singleTask"android:windowSoftInputMode="adjustResize"android:exported="true">
<intent-filter>
<actionandroid:name="android.intent.action.MAIN" />
<categoryandroid:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The text was updated successfully, but these errors were encountered:
It depends on the targetSdkVersion you have set in your build.gradle file inside the android directory. if targetSdkVersion < 33, then you do not need to read this comment further.
In android 14, there are few changes related SCHEDULE_EXACT_ALARM permission. Now permission of SCHEDULE_EXACT_ALARM is by default disabled by android. So setExact method of AlarmManager android API will throw an exception if user does not grant the permission explicitly.
So in your case, react-native-push-notification module is using "setExact" method internally and I think, that's why PushNotification.scheduleLocalNotification() is unable to work.
Question
I have used this library react-native-push-notifications in my react-native-app.
whenever i schedule any notification, it does not appear(even though it is listed in the getScheduledLocalNotifications() ), PushNotification.localNotification() works fine but the PushNotification.scheduleLocalNotification() does not work even in simpler circumstances.
notifications.android.ts
AndroidManifest.xml
The text was updated successfully, but these errors were encountered: