React-native-push-notification: LocalNotificationSchedule not working on android react native v0.60

Created on 1 Nov 2019  路  3Comments  路  Source: zo0r/react-native-push-notification

localNotificationSchedule is not working react-native-push-notification while localNotification is working normally:

PushNotification.localNotificationSchedule({ message: "Notification", date: new Date(Date.now() + 60 * 1000), id: "1" });

"react-native": "0.60.5",
"react-native-push-notification": "^3.1.1"

updating AndroidManifest as intended in https://github.com/zo0r/react-native-push-notification,

any help what should be done to display notification using localNotificationSchedule()

Most helpful comment

I just wanna butt-in and say the code above works in "react-native": 0.61.2

Definitely doesn't work for me. I can push local notifications, but localNotificationSchedule doesn't do anything.

All 3 comments

I just wanna butt-in and say the code above works in "react-native": 0.61.2

I just wanna butt-in and say the code above works in "react-native": 0.61.2

Definitely doesn't work for me. I can push local notifications, but localNotificationSchedule doesn't do anything.

I just wanna butt-in and say the code above works in "react-native": 0.61.2

Definitely doesn't work for me. I can push local notifications, but localNotificationSchedule doesn't do anything.

I'm new to React/React Native so excuse the ugly 'coding / coding style' (actually I haven't even touched them that much)

I have the following on my App.js file var PushNotification = require("react-native-push-notification"); PushNotification.configure({ onRegister: function(token) { console.log("TOKEN:", token); }, onNotification: function(notification) { console.log("NOTIFICATION:", notification); notification.finish(PushNotificationIOS.FetchResult.NoData); }, senderID: "YOUR GCM (OR FCM) SENDER ID", permissions: { alert: true, badge: true, sound: true }, popInitialNotification: true, requestPermissions: true });

And since I'm using react-navigation I have this code inside one of my screens
PushNotification.localNotificationSchedule({ message: "Notification", date: new Date(Date.now() + 10 * 1000), id: "1" });

I have this inside my android/build.gradle under buildscript
ext { buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 }

settings.gradle
include ':react-native-push-notification' project(':react-native-push-notification').projectDir = file('../node_modules/react-native-push-notification/android')

in 'android/app/src/res/values/colors.xml'
<resources> <color name="white">#FFF</color> </resources>

For the AndroidManifest.xml i just copy pasted everything in the readme but made sure they're in their proper places

I have not modified MainApplication.java

Note that it doesn't show up if you're on 'Do not disturb' mode.

I haven't used the localNotification (gcm/fcm) functionality yet so maybe there's an issue with using both at the same time?

Was this page helpful?
0 / 5 - 0 ratings