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

IOS SDK Auto play on AUTH

IOS SDK Auto play on AUTH

"We're experiencing issues with autoplay in our iOS app using the Spotify iOS SDK. Despite setting configuration.playURI = "" in our SPTConfiguration setup, tracks still auto-play when initialized. Here's our current implementation:

1. We set playURI to empty string in SPTConfiguration
2. We're using SPTAppRemote's playerAPI to control playback
3. We handle authentication through SPTSessionManager

Is there a specific configuration or method we should implement to ensure tracks only play when explicitly triggered by user action? We've noticed that even with playURI = "", tracks still auto-play when loaded.

Current relevant code:
```swift
private func setupSession() {
let configuration = SPTConfiguration(
clientID: config.clientId,
redirectURL: URL(string: config.redirectUri)!
)
configuration.playURI = "" // This doesn't seem to prevent autoplay
}

func play(tune: Tune) async throws {
guard let trackId = tune.tuneUrl?.components(separatedBy: "track/").last else {
throw AppError.audioError("Invalid tune URL")
}
self.appRemote?.playerAPI?.play("spotify:track:\(trackId)")
}
```

Is there an additional step or configuration we're missing to properly disable autoplay?"

 

 

 Regards Wayne

Reply
0 Replies

Suggested posts