Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在使用Cocoapods安装的React Native上安装扩展?_Ios_Npm_Cocoapods_React Native - Fatal编程技术网

Ios 如何在使用Cocoapods安装的React Native上安装扩展?

Ios 如何在使用Cocoapods安装的React Native上安装扩展?,ios,npm,cocoapods,react-native,Ios,Npm,Cocoapods,React Native,我刚刚按照此处的说明安装了React Native: 但是,我不知道如何安装像这样的第三方扩展。到目前为止,我尝试的是在ReactComponent目录中安装react本机图标。但是,当我运行应用程序时,它显示错误,说明react-native图标不能要求react-native,这是可以理解的,因为react-native不在节点模块中。那么,当React Native与CoCoapod一起安装时,安装扩展的正确方法是什么呢?任何提示都将不胜感激 如果要使用的扩展没有扩展,则需要为其创建一个

我刚刚按照此处的说明安装了React Native:


但是,我不知道如何安装像这样的第三方扩展。到目前为止,我尝试的是在ReactComponent目录中安装react本机图标。但是,当我运行应用程序时,它显示错误,说明react-native图标不能要求react-native,这是可以理解的,因为react-native不在
节点模块中。那么,当React Native与CoCoapod一起安装时,安装扩展的正确方法是什么呢?任何提示都将不胜感激

如果要使用的扩展没有扩展,则需要为其创建一个Podspec。您可以从扩展名的
package.json
文件复制大部分信息

一个示例podspec,摘自

#要了解有关Podspec的更多信息,请参阅http://guides.cocoapods.org/syntax/podspec.html
#
Pod::规格新do | s|
s、 name=“ReactNativeCouchbaseLite”
s、 version=“0.2.2”
s、 summary=“react native的couchbase lite绑定”
s、 许可证='MIT'
s、 平台=:ios,“7.0”
s、 需要_弧=真
s、 作者=“徐福瑞”
s、 主页=”https://github.com/fraserxu/react-native-couchbase-lite.git"
s、 source={:git=>'https://github.com/fraserxu/react-native-couchbase-lite.git' }
s、 source_files='ios/***.{h,m}'
s、 依赖项“couchbase lite ios”
s、 依赖项“couchbase lite ios/Listener”
结束

一旦你确认了它的工作原理,就可以像我一样用Podspec文件向作者发送一个pull请求:)

我遇到了同样的问题。你找到什么了吗?没有…我放弃了react native,转而使用真正的native应用程序。有人找到这个了吗?
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = "ReactNativeCouchbaseLite"
  s.version          = "0.2.2"
  s.summary          = "couchbase lite binding for react-native"
  s.license          = 'MIT'
  s.platform     = :ios, '7.0'
  s.requires_arc = true
  s.authors      = "Fraser Xu <xvfeng123@gmail.com>"
  s.homepage     = "https://github.com/fraserxu/react-native-couchbase-lite.git"
  s.source       = { :git => 'https://github.com/fraserxu/react-native-couchbase-lite.git' }
  s.source_files = 'ios/**/*.{h,m}'
  s.dependency 'couchbase-lite-ios'
  s.dependency 'couchbase-lite-ios/Listener'
end