可以在发布模式中从HTTP服务器中获取数据React本机

发布于 2025-02-10 08:45:39 字数 90 浏览 2 评论 0原文

我尝试从'http://12.12.129.302.253:9005'获取API,在调试模式下它正常工作。当我捆绑发布时,APIS不是Callabl。请任何解决方案。

I tried to fetch the api from 'http://12.129.302.253:9005', it work fine in debug mode.When I bundle release, apis are not callabl.Any solution please.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乱了心跳 2025-02-17 08:45:39

没有什么比它这样..确保您

androidmanifest.xml中添加了以下设置,在info.plist.plist中添加此

<uses-permission android:name="android.permission.INTERNET" />

iOS

<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key><YOUR DOMAIN eg: google.com ></key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

和 两个都。

There is nothing like it.. Make sure you have added the following settings

For Android in AndroidManifest.xml add this

<uses-permission android:name="android.permission.INTERNET" />

and for iOS in info.plist add this

<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key><YOUR DOMAIN eg: google.com ></key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

It should work for both.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文