react-native - How to check if 3rd party library is installed in React Native
问题描述
I have an app that do not published on App/Play Store and we have CodePush to release update to the app, as in the new release we have include a new react-native-image-picker library, as this 3rd party library is not able to publish via CodePush, how i can check/try..catch if the react-native-image-picker library is not installed for users that update app via CodePush?
possible to do something like this?
try {
import ImagePicker from "react-native-image-picker";
} catch (error) {
const ImagePicker = null;
}
解决方案
If you are able to generate/retrieve the CodePush's apk, you could try recompiling/reverse engineering the apk back into its source code by using a tool such as https://ibotpeaches.github.io/Apktool/. This would allow you to then inspect your 'CodePush' to determine whether or not it contains this react-native-image-picker-library.
推荐阅读
- nested - 在adonis2中测试嵌套效果的正确方法
- angular - 角条纹添加卡片表单只允许一个输入按钮提交
- tinymce - 固定工具栏容器和表情插件的 TinyMCE 问题
- pine-script - 如何使用 pine 编辑器在 Tradingdview 中导入交易历史?
- python - tkinter:单击按钮时如何打印列表?
- python - 使用 Dask(和/或 xarray)并行和懒惰地进行短时傅里叶变换(频谱分析)
- assembly - Push 和 pop 干扰 ret 指令
- python - 如何将 for 循环的输出通过管道传输到另一个变量中
- r - 在R中,为什么有
在我读取数据框时的第一行 - python - 使用熊猫旋转df后获取与最大值关联的行数据