react-native-assets-loader

react-native-assets-loader

Usage no npm install needed!

<script type="module">
  import reactNativeAssetsLoader from 'https://cdn.skypack.dev/react-native-assets-loader';
</script>

README

react-native-assets-loader

react-native-assets-loader

Installation

npm install react-native-assets-loader

Usage

react-native

import AssetsSourceLoader from "react-native-assets-loader";

// ...

new AssetsSourceLoader().initLoader()

android

 RNAssetsLoader.setRnAssetsFileDir(this.getFilesDir().getPath(),"https://sr.aihuishou.com/opt/apps/pjt-rn-assets/");

ios

 NSString *documentsPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject;
 NSString *rnAssetsDir = [documentsPath stringByAppendingString:@"/AHSReactNative/"];
 [RNAssetsLoaderInit setAssetsFilePath:rnAssetsDir remotePath:@"https://sr.aihuishou.com/opt/apps/pjt-rn-assets/"];

github

License

MIT