0

I have installed the library following all the steps in the documentaiton, created the app on firebase using the SHA-1 from the project (generating using gradle), downloaded the google-services.json file and add it under the folder app.

Here's the code:

  useEffect(() => {
    Notifications.events().registerRemoteNotificationsRegistered(
      ({ deviceToken }) => {}
    );

    Notifications.events().registerRemoteNotificationsRegistrationFailed(
      (event) => {
        console.error(event);
      }
    );
  }, []);

But the registerRemoteNotificationsRegistered is not triggered, neither registerRemoteNotificationsRegistrationFailed.

The only step I'm missing from the guide is the four (https://wix.github.io/react-native-notifications/docs/installation-android) because apply plugin: 'com.google.gms.google-services' cause the build to fail.

Some problems were found with the configuration of task ':react-native-notifications:processReactNative60DebugGoogleServices' (type 'GoogleServicesTask').
  - In plugin 'com.google.gms.google-services' type 'com.google.gms.googleservices.GoogleServicesTask' field 'intermediateDir' without corresponding getter has been annotated with @OutputDirectory.
    
    Reason: Annotations on fields are only used if there's a corresponding getter for the field.
    
    Possible solutions:
      1. Add a getter for field 'intermediateDir'.
      2. Remove the annotations on 'intermediateDir'.

Here is the version: react-native: 0.71.4 => 0.71.4

PietroPutelli
  • 482
  • 4
  • 20

0 Answers0