Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

I retrieve my phone device ID and a proper token - but there is no error and no song playing.

I retrieve my phone device ID and a proper token - but there is no error and no song playing.

 

Plan

Premium

Country

USA

Device

aatt motivate max

Operating System

Android, Windows 10

Dev Platform

Android Studio (.kts not .js)

 

 

 

My Question or Issue

I retrieve my phone device ID, a proper token but it is never listed as active .

I use kotor for the header

 

      HttpClientManager.httpClient.put("https://api.spotify.com/v1/me/player/play") {
            headers {
                append(HttpHeaders.Authorization, "Bearer $accessToken")
                append(HttpHeaders.ContentType, "application/json")
            }
            setBody(PlaybackRequestBody(listOf(trackUri), positionMs, deviceId))

// no error is  caught
          println("Playback started successfully!")
    } catch (e: Exception) {
        // Handle error (e.g., log the exception)
        println("Error starting playback: ${e.localizedMessage}")
    }

 

 

There is no error but there is no song volume. the song does not seem to be triggered.

Is there a way to dig deeper into the problem so I can find where the playback is breaking?

 

I can  play a song with the android.sdk with the same track uri.  I need to start  from a  forward position in the song so i need use the web api instead of the android sdk,

I attached the code that i call for the play.

Thanks in advance.

Reply
0 Replies

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random