Announcements

Help Wizard

Step 1

NEXT STEP

Using the ios-sdk to control Spotify in app

Using the ios-sdk to control Spotify in app

I am writing a fitness app and I am trying to use the ios-sdk to control Spotify. I would like to be able to:

* See the album art

* See title/artist

* See song duration

* Play/Pause/Skip/Scrub

 

Currently, I am using SPTSessionManager to get a session. We have implemented the renew and swap endpoints on our server. We can get authenticated and perform the above tasks. The issue arises when the user restarts the application. The session manager loses the session and the user needs to re-authenticate. I have tried to cache the SPTSession manually, renew the session once the app restarted. This works sometimes but not all times. Ultimately this has lead to the app launching Spotify sporadically when the user accesses our Spotify player in app.

 

So my question is: "Am I using the ios-sdk correctly? Or is there a better way to control the Spotify player from in app?"

Reply
2 Replies

Hey there,

You might be able to use the steps from this article to improve this: https://developer.spotify.com/documentation/ios/guides/application-lifecycle/. Let me know if you have any questions!

Have a good one,
Hubo
HuboSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

This does not help. We are already doing this.

Suggested posts