-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ios如何添加更新 #2
Comments
导入之后,我这边iOS会编译报错 |
pod install 报错 |
这个框架目前只支持android,我的解决办法是把RNXUpdate.podspec里的s.homepage修改成"https://github.com/author/RNXUpdate";然后自己在iOS原生定义RNXUpdate类处理iOS的升级 |
改了s.homepage后,pod install 不报错了,但是运行ios项目时会报错,说native module can not be null , 这个ios项目怎么做处理? |
Q1.
一种解决办法是手动修改../node_modules/react-native-xupdate-new中podspec文件内的s.homepage,使其不为空值。这么做能临时解决问题,但不完美。 第二种解决方法是 使其在ios环境下不自动链接 xupdate,完美解决pod install的报错。(推荐做法) // react-native.config.js
module.exports = {
dependencies: {
'react-native-xupdate-new': {
platforms: {
ios: null, // disable ios platform, because the lack of homepage in podspec file
},
},
},
}; How can I disable autolinking for unsupported library? Q2
解决办法是ios和android分别使用不同的js文件。 React Native 会检测某个文件是否具有.ios.或是.android.的扩展名,然后根据当前运行的平台自动加载正确对应的文件。 比如你可以在项目中创建下面这样的组件: BigButton.ios.js 然后去掉平台扩展名直接引用: import BigButton from './BigButton'; |
请问一下大佬ios如何添加更新
The text was updated successfully, but these errors were encountered: