I am trying to link the @segment/analytics-react-native library in my iOs react-native project.
I followed these two steps given in their docs.
yarn add @segment/analytics-react-nativeyarn react-native link
However the yarn react-native link step doesn't seem to work, as all it does is add a pod in the podfile, and modify some android project files that I don't need.
The project.pbxproj file is showed as modified but when I inspect it inside vs code, the only thing it does in that file is removing a line.
Please explain why is this happening
From the docs about linking
This means that it will not add the dependencies inside your Xcode project.
If you are happy with this then make sure you
cdinto youiOSfolder and runpod installIf you don’t want it installed via CocoaPods then you can either install it manually using the instructions on the dependencies repo (remembering to delete the line added to your pod file); or you can rename your podfile, run
react-native linkso it adds the files without the updating the podfile, then rename the podfile back to what it should be.One further point to note you shouldn’t run
react-native linkwithout the dependency name. You should runreact-native link <dependency name>. You can end up with duplicate entries and unforeseen issue if you don’t.