React Native project with push notifications, I use this.
I follow this tutorial.
I only need local notifications. But if I run this project I get an error default firebaseapp is not initialized in this process
.
I follow this answer and get a google service.json from firebase to make it start (notification don't show up unfortunately). But is this also possible without firebase?
requestPermissions: Platform.OS === 'ios', This line you have to add
import { Platform} from 'react-native';
PushNotification.configure({
onRegister: function (token) {
console.log("TOKEN:", token);
},
onNotification: function (notification) {
console.log("NOTIFICATION:", notification);
},
permissions: {
alert: true,
badge: true,
sound: true,
},
popInitialNotification: true,
requestPermissions: Platform.OS === 'ios',// This line you have to add //import Platform from react native
});
Yes, it is possible to push local notification without firebase. I implemented it in one of my projects. You can take reference from this comment.
And also you don't have to call register methods from example
which is available in react-native-push-notifications repo.
PS: As author did not marked any of the above answers as resolved. I hope this will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With