1

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?

DuDa
  • 3,718
  • 4
  • 16
  • 36
Harold
  • 11
  • 1
  • 2

3 Answers3

0
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
    });
Rajan rek
  • 322
  • 2
  • 8
0

This package does work without firebase, after installing and setting up clear gradle cache.

On Windows: gradlew cleanBuildCache

On Mac or UNIX: ./gradlew cleanBuildCache

0

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.

Dexter
  • 1
  • 2