And Spotify hasn’t had in app purchasing of subscriptions on iOS for over a decade. Apple has never once said you would get malware by using Safari.
Who do you think is stopping from that happening?
Apple makes no money from the Spotify app being on the iPhone and hadn’t for over a decade.
Music was played by the iTunes process on mobile until 2016, and only a single audio stream at a time. How dare you wanted a fade in/out with less than 3 seconds latency!
And even then Apple was reluctant to implement a correct Promise based Audio API in WebKit, which in turn was incompatible with all other Web Browsers (up until today, btw) and also had very different audio formats supported that were only compatible with iOS due to proprietary patents.
Saying WebKit played music in 2007 is literally a worse experience than a Flash web player doing that.
The question was why did Spotify have to use an app instead of using the web.
But then again, are you really saying that Android users don’t use the app?
But … I don’t?
I download and install Spotify.app on my computer (at least my gf does on hers, I use Apple Music). Maybe I am the weird one? No I am not, I skimmed the Spotify subreddit and most use the app on PC/Mac: It has keyboard shortcuts, people find it nicer being its own program instead some browser tab, it is more lightweight, it provides offline play and crossfading and has (freemium and paid) higher bitrate than web. It is you who are missing out.