如何通过反应本机资产文件路径到本机模块ios/android

发布于 2025-02-13 11:11:07 字数 526 浏览 0 评论 0原文

我在我的React Antive Assets文件夹中有一些静态文件,我想将这些文件传递给本机模块Android/ios,是否有任何方法可以将文件路径传递给本机模块

实际上是我使用React> React-native-- FS记录目录及其给出的绝对文件路径如下

/users/jos/library/developer/coreSimulator/devices/b186bc56-78dc-496b-83d2-3095bcb8be08/data/co ntainers/data/application/162A2FFD-2B19-4946-8E92-AFE167633AEB/Library/Files/Files/Music/prompter.wav

我将这条路径传递到本机模块,而我的本地模块正常工作。但是我的资产文件夹中有一些静态文件,我正在发送这些路径,例如../../资产/demo_songs/music.wav,然后我的本机模块不起作用。请帮助我如何将静态资产文件路径发送到本机模块

i have some static files in my react native assets folder, i want to pass those files to native modules Android/iOS, is there any way to pass file paths to native modules

Actually i downloading files from s3 using react-native-fs to document directory and its giving absolute file path like below

/Users/jos/Library/Developer/CoreSimulator/Devices/B186BC56-78DC-496B-83D2-3095BCB8BE08/data/Containers/Data/Application/162A2FFD-2B19-4946-8E92-AFE167633AEB/Library/files/Music/prompter.wav

i'm passing this path to Native Modules and my native modules working fine. But i have some static files in my assets folder i'm sending those paths like ../../assets/demo_songs/music.wav then my native modules not working. Please help me how to send static assets file paths to native modules

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文