如何在Xcode中添加第三方库“ greact-acr-cloud”? (本机项目)

您好,我已使用npm“ npm i greact-acr-cloud ”将此依赖项添加到我的项目中。

应该将此依赖项使用设备的麦克风来捕获声音。我有一个按钮可以触发函数来执行此操作,但是此操作目前仅适用于android。

...
import greactAcrCloud from "greact-acr-cloud";

const getsong = props => {
    greactStart = () => {
        greactAcrCloud.start()
          .then((response) => {

            props = response
            console.log(response);
            console.log(props.metadata.music);
          });
        }
   return (
      <Button onPress={() => greactStart()}>
        ....
  )

}

但是,对于iOS,我不确定是否将其正确添加到项目中。 这是我的库在xcode中的样子。 Xcode library of Greact-acr-cloud 我已经尝试进入项目的ios文件夹,并在终端中输入“ pod install”,但是我收到了。

[!] use_native_modules! skipped the react-native dependency 'greact-acr-cloud'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The
react-native-webview podspec is a good example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary,you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library

我还在 info.plist 文件enter image description here

中添加了“隐私-麦克风使用说明”键。

我哪里出问题了? 即使在运行该应用程序时,它也永远不会征求使用麦克风的许可。

到目前为止,如果我从库中删除Greact-acr-cloud.xcodeproj,该应用程序将生成,但该功能当然无法正常工作。按下按钮后,我收到警告,提示类似的内容。

Possible Unhandled Promise Rejection (id: 3): TypeError: null is not an object (evaluating 'GreactAcrCloud.start')

这可能是因为麦克风没有捕获任何声音,因此返回了null ...? 知道我在ios上哪里出错了吗?它可以在Android上完美运行,并为我提供所需的结果。请帮助...

msgl88 回答:如何在Xcode中添加第三方库“ greact-acr-cloud”? (本机项目)

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2981087.html

大家都在问