Add music to iOS programmatically

Let's say I want to create an iOS application that downloads music files from the Internet.

Is it possible to place these music files in the Music Library so that I can play it?

+4
source share
4 answers

It's impossible. The only way to add music to your library is through iTunes or through the iTunes Store app. Even if you find a way, it will probably be through a private API, and you are likely to get a denial of application storage.

+3
source

As Simon said, you won’t get music in your native music library. However, you can save audio files and use the AVFoundation Framework (class AVAudioPlayer) to play them. You can also use the AudioToolbox system. The problem is that you have to implement your own music library and your own playback functions.

Did I mention that you have an approximately 0% chance that this application will go to the application store?

Obviously, though ... even trivial ...

+1
source

Well, in terms of features, if you can jailbreak your device, you will need 2 tricks:

"Safari download enabler" or manager: so you can upload files. "Bride": allows you to import downloaded or saved mp3 files or mp4 files into your iOS library.

I used it for a while and it works like magic

0
source

You may have a private API / library. Although I have never tried, but you can.

Here is another post:

Programmatically add content to the music library

0
source

Source: https://habr.com/ru/post/1439166/


All Articles