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

Event listeners are not triggered when app is running in the background #227

Open
MehediH opened this issue Jan 24, 2023 · 3 comments
Open

Comments

@MehediH
Copy link

MehediH commented Jan 24, 2023

Any of the event listeners added to SpotifyRemote don't get triggered when the app is running in the background. It only works when the app is active and in focus - is this intentional?

Is there anyway to have the event listeners work even when the app is running in the background (including when the phone is locked)? Mainly need this for the playerStateChanged event. Thank you!

@cjam
Copy link
Owner

cjam commented Jan 30, 2023

hmm.. You're talking about within your app? I had a similar issue and it was due to iOS backgrounding / sleeping my app and disconnecting the remote connection with spotify. You just need to employ a strategy to keep your app from being backgrounded. There are a few sdk's that if in use will prevent iOS from backgrounding your app. Audio and GPS are two that come to mind that you could investigate.

It's pretty lame, I wish there was some sort of real time entitlement for iOS that you could use to prevent your app from being backgrounded. Maybe there is? worth an investigation.

@MehediH
Copy link
Author

MehediH commented Jan 30, 2023

Yes within my app. Do you have an example of how you got it to stop iOS from backgrounding the app?

@Pashkagreen
Copy link

Yes within my app. Do you have an example of how you got it to stop iOS from backgrounding the app?

Hello, @MehediH! Have you solved this problem?

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

3 participants