I know there are similar questions, but every solution I've tried has failed, unfortunately. I'm using react-native-youtube and the sound of the videos is not playing on iOS when the phone is in silent mode.
I tried importing <AVFoundation/AVFoundation.h>
in the beginning of AppDelegate.m
and added this line
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error: nil];
at the bottom of didFinishLaunchingWithOptions
as described in their README.
I also tried enabling Audio on the Background Modes in Xcode and added audio in the Background modes in the Info.plist file.
React Native 0.44.3react-native-youtube 1.1.0iOS 11.2.2