5

I am trying to configure OneSignal React Native in a React Native application for push notification purposes.

Environment Setup

  1. react-native version : 0.60
  2. npm version 10.5

I followed the steps below from the official documentation of React native one signal for setting it up:

step 1 : npm install -g react-native-cli, status : done

step 2 : react-native init OneSignalDemo, status : done

Before linking the project I ran my project successfully with the commands below:

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
react-native run-android

step 3: While linking my library with react-native link react-native-onesignal I got an error in my terminal. Linking oneSignal with my App (As per official documentation), status : fail

Error:

Package react-native-onesignal has been ignored because it contains invalid configuration. 
Reason: Unknown option dependency.platforms.ios.sourceDir with value ""./ios"" was found. 
This is either a typing error or a user mistake

One possible solution that I tried was to create new React Native project with version 0.58.0 as per documentation, but I keep getting the same error.

David Buck
  • 3,752
  • 35
  • 31
  • 35
Hardik Desai
  • 1,089
  • 12
  • 20
  • 1
    What do you want to achieve? What did you try already? We cannot help if you don't provide more details.. – SBylemans Jul 08 '19 at 11:24
  • thank you this . i edit my question in details please have a look. – Hardik Desai Jul 08 '19 at 17:04
  • I don't know much about react, but judging by your error message, you have configured an `ios` directory somewhere, or that directory is present somewhere? – SBylemans Jul 09 '19 at 07:43
  • 1
    **$ rm -rf package-lock.json node_modules $ npm install** these two commands fixed my issue – Basha K Jul 09 '19 at 09:29
  • @SBylemans Thank you for your valuable input,when we perform first two steps it will (React native) automatically create ios and adnroid directory in your project root folder – Hardik Desai Jul 09 '19 at 16:28

1 Answers1

3

i got the warn message but simple npm i solved the issue for me

Aayush Bhattacharya
  • 1,628
  • 18
  • 17