Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

How to add 'greact-acr-cloud', a third party library in Xcode? (React-native project)

$
0
0

Hello I have added this dependency to my project using npm, 'npm i greact-acr-cloud'.

This dependency is supposed to use the device's microphone to capture sound. I have a button that triggers the function to execute this, but this only works on android at the moment.

...
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()}>
        ....
  )

}

However, with iOS, I am not sure if I am adding it correctly to the project. Here is what my library looks like in xcode. Xcode library of Greact-acr-cloud I've tried going into the ios folder of the project and entering 'pod install' within the terminal, but I receive this.

[!] 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

I also added the Privacy - Microphone Usage Description key within the info.plist file enter image description here

Where could I be going wrong? Even when running the app, it never asks for permission to use the microphone.

As of now if I remove the Greact-acr-cloud.xcodeproj from the library, the app will build, but the function will not work of course. After pressing the button I get a warning stating something like.

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

This could be because the microphone isn't catching any sound therefore null is being returned...? Any idea where I am going wrong on ios? It works perfect on Android and gives me the results I need. Please help...


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>