smallnew / react-native-smartassets Goto Github PK
View Code? Open in Web Editor NEWsmart load react native image resource both from apk(ipa) and jsbundle Dir.
License: MIT License
smart load react native image resource both from apk(ipa) and jsbundle Dir.
License: MIT License
Hi,IOS 热更后,现象如题
环境
ios 12.4.3
iphone 6plus
react native 0.61.5
初始化
`import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import {SmartAssets} from 'react-native-smartassets';
SmartAssets.initSmartAssets();
AppRegistry.registerComponent(appName, () => App);`
测试后发现 android 能正常显示,ios 则不能,没有找到合适的调试方法,就直接alert,最后发现
是路径拼接的有问题 ,我自己改了下,改好了,
改的地方如下
const defaultMainBundePath = Smartassets.DefaultMainBundlePath; // 原来被注释掉了,加回来
...
...
let oriJsBundleUrl = 'file://'+defaultMainBundePath+'/'+iOSRelateMainBundlePath + "/"; // 默认缺了一个 / 符号,加上
改动后,一切正常了
看下是不是还有更合适的方法
SmartAssets.setiOSRelateMainBundlePath('./ios/platform.ios.bundle');
SmartAssets.setiOSRelateMainBundlePath('./ios/index.ios.bundle');
试了这两种写法,都不行,大神指点一下奥
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.