【问题标题】:cordova-plugin-whitelist codova plugin is not supported for iosios 不支持cordova-plugin-whitelist 科尔多瓦插件
【发布时间】:2019-05-24 16:37:03
【问题描述】:

我正在尝试使用 ionic 4 从服务器检索一些数据,该应用程序实际上在浏览器上运行良好,但是当我使用真实设备时它不起作用,在互联网上搜索数小时后,我找到了一个解决方案安装一个名为cordova-plugin-whitelist的Cordoba插件,当我添加这个插件时,该应用程序在android设备上运行良好但不是IOS设备,我检查了电容器DOC,然后我发现我必须运行这个命令:

ionic cap sync

在这个命令执行后,我收到了这条消息:

> capacitor add ios
✔ Installing iOS dependencies in 13.50s
✔ Adding native xcode project in: /Users/assenaneyoussef/Documents/Projects/Mobile_Projects/Test/ios in 103.53ms
✔ add in 13.61s
✔ Copying web assets from www to ios/App/public in 801.08ms
✔ Copying native bridge in 7.42ms
✔ Copying capacitor.config.json in 1.46ms
✔ copy in 868.93ms
✔ Updating iOS plugins in 8.30ms
  Found 0 Capacitor plugins for ios:
✔ Updating iOS native dependencies in 13.43s
  Found 1 incompatible Cordova plugin for ios, skipped install
    cordova-plugin-whitelist (1.3.3)
✔ update ios in 13.47s

Now you can run npx cap open ios to launch Xcode
> capacitor sync ios
✔ Copying web assets from www to ios/App/public in 977.67ms
✔ Copying native bridge in 5.90ms
✔ Copying capacitor.config.json in 2.00ms
✔ copy in 1.12s
✔ Updating iOS plugins in 4.85ms
  Found 0 Capacitor plugins for ios:
✔ Updating iOS native dependencies in 5.34s
  Found 1 incompatible Cordova plugin for ios, skipped install
    cordova-plugin-whitelist (1.3.3)
✔ update ios in 5.36s
Sync finished in 6.534s
```
if you noticed on the bottom of the message you'll finde a wierd message:
Found 1 incompatible Cordova plugin for ios, skipped install, is that normal ?

【问题讨论】:

    标签: node.js cordova angular7 ionic4 capacitor


    【解决方案1】:

    cordova-plugin-whitelist 不支持 iOS(因为不需要它)。该消息可能有点误导。 只需检查插件代码,它没有 iOS 文件夹 https://github.com/apache/cordova-plugin-whitelist/tree/master/src

    【讨论】:

    • aah 好的,但我无法从 iOS 设备上的服务器检索数据,您有什么建议?
    • 用你在做什么的代码示例创建一个新问题
    • 我想我不需要创建一个新问题,因为它已经很清楚了,当我使用真实的 iOS 设备(本地主机)时,我无法从 nodejs 服务器检索数据,你认为这是什么原因有问题吗?
    • 嗯,localhost 的意思是“这个设备”,所以如果你尝试从设备上的 localhost 获取一些东西,它会失败,因为设备没有运行服务器,你的计算机是。所以你必须使用计算机的本地 IP 而不是 localhost。看,这不是你的问题,所以这就是为什么你应该创建一个新的,或者至少编辑这个以提供这种信息和你正在使用的代码。
    • 也许你是对的,我之前考虑过,无论如何我会尝试将localhost更改为我的IP地址,然后我会回复你,谢谢。
    猜你喜欢
    • 1970-01-01
    • 2019-08-13
    • 2020-05-16
    • 1970-01-01
    • 2015-09-08
    • 2015-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多