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

Cannot find .caf file with URLForResource in React-native module

$
0
0

I am still fairly new to ios development so bear with me. I am developing a react-native module for IOS which checks if the audio is muted. The module is a copy of the ios app: Github repo.

I got everything to work in my react-native module except that it can't find the audio file, which is needed to check if the audio is muted. The following line is used to find the url of the audio file, but it always returns null:

NSURL* url = [[NSBundle mainBundle] URLForResource:@"MuteChecker" withExtension:@"caf"];

I have tried linking this file in my project, but without any result. Could someone explain if you need to search another way in react-native?


Viewing all articles
Browse latest Browse all 16552

Trending Articles



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