0

I've been working with React Native for about a year, and have always linked native modules either with react-native link or by manual linking, by dragging the .xcodeproj file to the Libraries folder and then dragging the .a file to the "Link Binary With Libraries" section of Build Phases. I'd heard of Cocoapods, and my project does include a Podfile (not sure where it came from), but it wasn't until recently that someone told me I HAD to use Cocoapods in order to link native modules, by doing cd ios + pod install etc.

What I Want To Know:

What's the difference between linking native modules the way I've done it all along, and doing it via Cocoapods? What's the essence of Cocoapods and how does it fit into React Native development vs regular linking?

gkeenley
  • 6,088
  • 8
  • 54
  • 129
  • This outlines it quite well https://github.com/react-native-community/discussions-and-proposals/issues/96 – Madison Courto Sep 13 '19 at 00:11
  • Please refer this stack overflow article. [https://stackoverflow.com/questions/45296994/difference-between-react-native-link-and-cocoapods](https://stackoverflow.com/questions/45296994/difference-between-react-native-link-and-cocoapods) – Vishu Bhardwaj Sep 13 '19 at 05:50

1 Answers1

0
  1. For manually integrated module most cases you have to link some system files if library have some dependencies but for cocoa pod all dependencies liked automatically

  2. For manually integrated module you need to update library manually but for cocoa pod you can it by just pod install command from terminal

  3. In which case which one is better? when your library need update frequently you should choice cocoa pod but when you want to modify a cocoa pod library you would choice it to integrated manually.

Jamil
  • 2,977
  • 1
  • 13
  • 23
  • So for any given module, can you CHOOSE to incorporate it as either a manually integrated module or via cocoapods? Can you incorporate it using both ways? – gkeenley Sep 13 '19 at 10:14
  • cocoa pod is better – Jamil Sep 14 '19 at 05:21
  • Noted, but my question was whether you can choose to incorporate it as either a manually integrated module or via cocoapods. I'm trying to understand conceptually the role that each has. – gkeenley Sep 16 '19 at 00:08
  • cocoa pod is preferred – Jamil Sep 17 '19 at 05:53
  • Is it the case that they both seek to accomplish the same thing, but that Cocoapods does a better job? Or does each have a different goal that they're trying to accomplish? – gkeenley Sep 17 '19 at 15:57