简体   繁体   English

为 iOS 在本机反应中创建自己的依赖项

[英]Create own dependency in react native for iOS

I'm creating first react-native dependency for both android and iOS.我正在为 android 和 iOS 创建第一个 react-native 依赖项。 I have done coding part for android but now I'm stuck in iOS.我已经完成了 android 的编码部分,但现在我被困在 iOS 中。 Where to write code for my library and how to test.在哪里为我的库编写代码以及如何测试。

React Native uses CocoaPods to manage iOS project dependencies and most React Native libraries follow this same convention. React Native 使用 CocoaPods 来管理 iOS 项目依赖项,大多数 React Native 库都遵循相同的约定。

Run pod install in our ios directory in order to link it to our native iOS project.在我们的 ios 目录中运行 pod install 以将其链接到我们的原生 iOS 项目。 A shortcut for doing this without switching to the ios directory is to run npx pod-install.在不切换到 ios 目录的情况下执行此操作的捷径是运行 npx pod-install。 Once this is complete, re-build the app binary to start using your new library: npx react-native run-ios.完成后,重新构建应用程序二进制文件以开始使用您的新库:npx react-native run-ios。

For testing the code you could use Jest testing framework.要测试代码,您可以使用 Jest 测试框架。 go onto the ReactNative for more guidance. go 到 ReactNative 以获得更多指导。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 响应本机ios RNFirebase依赖关系分析错误。 无法运行命令“ Libtool libRNFirebase.a”-该目标可能包含其自己的产品 - React native ios RNFirebase dependency Analysis Error. Unable to run command 'Libtool libRNFirebase.a' - this target might include its own product 在 Objective-c 中使用 React Native iOS 依赖 - Using React Native iOS dependency in Objective-c 手动将React Native依赖项导入现有的iOS应用 - Import React Native dependency to existing iOS app manually 运行 react native ios 应用程序时找不到文件依赖项错误 - File not found dependency error while running react native ios app React Native(IOS),如何创建滚动视图? - React Native (IOS), how to create a view that scrolls? 无法为本机创建脱机捆绑包(iOS) - Cannot create offline bundle for react native (iOS) 如何在iOS上的react-native中创建本机文件? - How to create a native file in react-native on iOS? React Native模块中的依赖注入 - Dependency Injection in React Native modules 是否可以在 React-Native(iOS&Android) 中获得自己设备的 BLE Mac? - Is it possible to get BLE Mac of own device in React-Native(iOS&Android)? 是否可以使用Windows 10和React Native创建iOS应用(.ipa)? - Is it possible to create an iOS app (.ipa) with Windows 10 & React Native?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM