Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background notifications from Spotify to my app(in background) using Spotify iOS SDK #77

Open
joshehrlich24 opened this issue Jan 17, 2019 · 1 comment

Comments

@joshehrlich24
Copy link

Is there a way to receive playerStateDidChange notifications from Spotify while my app is in the background (I am happy to add whatever iOS background mode, if necessary). The goal is for my app to stay in sync with Spotify when a user changes the song through Spotify and not my app.

I am getting notified of events via playerStateDidChange when my app is in the foreground.

@nicoletapop
Copy link

@joshehrlich24 there is a stub in SPTAppRemoteDelegate methods called appRemoteDidEstablishConnection, in which all UI updates could be done, according to the screen where you will arrive after switching from the native Spotify app. I can assure you that this method will be called whenever your app will come back from the background, because SPTAppRemote disconnects when you switch to another app and yours will enter this state (in this case, the stub appRemoteDidDisconnectWithError will be called) and attempting to connect when entering foreground (is the Spotify app is running and playing music of course, otherwise you have to wake it up using authorizeAndPlayURI method).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants