wix / react-native-notifications

React Native Notifications
MIT License
3.25k stars 764 forks source link

Autolinking does not work with React Native 0.69.0 #881

Closed Naturalclar closed 2 years ago

Naturalclar commented 2 years ago

Issue

Due to change in react-native cli, https://github.com/react-native-community/cli/pull/1537 Autolinking is no longer working with React Native 0.69

Expected Behavior

React Native autolinking to work with RNNotifications

Repro Steps:

Notice that RNNotifications is not included in the Podfile.lock

Repro repository https://github.com/Naturalclar/react-native-notifications-repro

alexanderoskin commented 2 years ago

Same.

Due to https://github.com/react-native-community/cli/pull/1537 some things in react-native.config.js have been deprecated and removed, thus failing autolinking schema validation (for example dependency.assets).

Steps to Reproduce

Create a vanilla RN project with latest 0.69.1 with npx react-native init Example. Add this package. Observe it not being autolinked.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

haleyngonadi commented 2 years ago

Bumping! I'm also facing the same issue with 69.1

Running npx react-native run-ios returns an error:

warn Package react-native-notifications contains invalid configuration: "dependency.assets" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this.

nguyendinhdoan commented 2 years ago

I'm getting the same issue warn Package react-native-notifications contains invalid configuration: "dependency.assets" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this.

Erik-Schlegel commented 2 years ago

Same issue with react native 69.1 regarding "dependency.assets".

03Farhan commented 2 years ago

You can make a patch using changes from https://github.com/wix/react-native-notifications/pull/882. Hopefully that change is merged soon, but in the meantime you can do this:

  1. install patch-package
  2. create a folder in your project called "patches"
  3. inside "patches" create a file named react-native-notifications+4.3.1.patch with the following content:
    
    diff --git a/node_modules/react-native-notifications/react-native.config.js b/node_modules/react-native-notifications/react-native.config.js
    index 437783b..d246b0c 100644
    --- a/node_modules/react-native-notifications/react-native.config.js
    +++ b/node_modules/react-native-notifications/react-native.config.js
    @@ -7,7 +7,6 @@ module.exports = {
         packageInstance: 'new RNNotificationsPackage(reactNativeHost.getApplication())',
       }
     },
    -    assets: []
    },
    project: {
     ios: {
4. add "patch-package" in postinstall in package.json before doing yarn install.
`package.json`:

"scripts": { ... "postinstall": "patch-package" }


5. run `yarn install` or `npm install`
xtovski commented 2 years ago

Same thing on RN 0.7.0, with react-native-notifications 4.3.1

warn Package react-native-notifications contains invalid configuration: "dependency.assets" is not allowed. 
Please verify it's properly linked using "react-native config" command and contact the package maintainers about this.
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 2 years ago

The issue has been closed for inactivity.

ajithes1 commented 1 year ago

+1

ZiaSoltani2023 commented 1 year ago

any update on this issue still facing it. Thanks