tvillarete / ipod-classic-js

An iPod Classic emulator that connects to Apple Music and Spotify. Built with React & Styled Components
http://tannerv.com/ipod
MIT License
1.45k stars 108 forks source link

iOS HomeScreen Bookmark: Support background play #38

Closed cyriac closed 3 years ago

cyriac commented 3 years ago

Opening the app on Chrome or Safari on iPhone, and switching apps continues to play the song in the background, including the locked screen state.

But once you add it to the Home screen via - Safari > Share icon > Add to Home Screen. The "app" added to the home screen does not play songs in the background, stops immediately when you switch the app or the screen locks.

crutchcorn commented 3 years ago

Seems like this is a limitation of iOS:

https://blog.prototyp.digital/what-we-learned-about-pwas-and-audio-playback/

Maybe we could wrap inside of Cordova and make a publish-able iOS app?

https://thecodebeast.com/post/cordova-allow-audio-to-play-in-background-and-in-silent-switch/72

Maybe even using Airport to sidestep some of the Apple publishing rules?

https://airport.community/

tvillarete commented 3 years ago

Hey @cyriac, I was actually chatting with a Spotify dev and they mentioned this as one of the current roadblocks for iOS browser support they've run into. It is indeed a limitation of iOS Home Screen bookmarks, and from what I heard they want to support it but are limited by Apple unfortunately.

tvillarete commented 3 years ago

Maybe we could wrap inside of Cordova and make a publish-able iOS app?

This sounds like a repeat of history in the making 😅 There was an app called Rewound that got pulled from the App Store that was accomplishing something similar.

Maybe even using Airport to sidestep some of the Apple publishing rules?

Interesting! I'm not really sure how iOS WebView would handle Spotify or even Apple's SDKs, but might be worth a shot 🤷

tvillarete commented 3 years ago

Going to close this issue as there aren't many actionable items in the scope of this web project. I definitely appreciate the suggestions though!