Playing audio files on iOS

With the iPod and the digital music revolution, a digital portable media device became a must-have for even the most casual music listeners. The smartphone has superseded the media device, with many users storing large music libraries on their phones. It is only natural for other applications to want to access the music library.

In this recipe, we will create a native module to show the iOS mediaPicker and then select a music file to play. The file will play through the iOS native media player, allowing the music to play in the background and be controlled by the iOS control center.

Getting ready

For this recipe, we created a React Native application titled AudioPlayer.

In this recipe, we will use the react-native-button ...

Get React Native Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.