spotify_sdk 4.0.0 copy "spotify_sdk: ^4.0.0" to clipboard
spotify_sdk: ^4.0.0 copied to clipboard

A Flutter plugin for communicating with Spotify App Remote SDK and Spotify Web Playback SDK.

4.0.0 #

A major release bringing federated monorepo architecture, zero-configuration Android setup, Spotify Android Auth SDK 5.0.0, native iOS playback feature parity, typed domain exception hierarchy, Web Playback SDK with modern package:web / WASM support, and compatibility with Flutter 3.47.1 & Dart 3.13.

⚠️ Breaking Changes & Migration Guide #

1. Android Zero-Configuration SDK Auto-Download

  • What changed: The plugin now automatically resolves and downloads the native Spotify App Remote SDK binary during Gradle compilation.
  • Migration:
    • Remove dart run spotify_sdk:android_setup from any setup scripts (deprecated & removed).
    • Remove include ':spotify-app-remote' from android/settings.gradle / android/settings.gradle.kts.
    • Delete the legacy android/spotify-app-remote folder if present from previous installations.

2. Android Auth SDK v5.0.0 Migration

  • What changed: Upgraded from Spotify Android Auth 2.x to com.spotify.android:auth:5.0.0. Manifest placeholders (redirectSchemeName, redirectHostName) are no longer used.
  • Migration:
    • In android/app/src/main/AndroidManifest.xml, register RedirectUriReceiverActivity directly inside <application>:
      <activity
          android:name="com.spotify.sdk.android.auth.browser.RedirectUriReceiverActivity"
          android:exported="true">
          <intent-filter>
              <action android:name="android.intent.action.VIEW" />
              <category android:name="android.intent.category.DEFAULT" />
              <category android:name="android.intent.category.BROWSABLE" />
              <data
                  android:scheme="your-redirect-scheme"
                  android:host="your-redirect-host" />
          </intent-filter>
      </activity>
      

3. Structured Domain Exceptions (SpotifyException)

  • What changed: Replaced generic, untyped PlatformExceptions with a structured domain exception hierarchy inheriting from SpotifyException (SpotifyAuthenticationException, SpotifyConnectionException, SpotifyPlaybackException, SpotifyUnsupportedException, SpotifyRateLimitException, SpotifyUnknownException).
  • Migration:
    • Catch typed SpotifyException subclasses instead of relying on PlatformException.code string matching:
      try {
        await SpotifySdk.connectToSpotifyRemote(...);
      } on SpotifyAuthenticationException catch (e) {
        // Authentication failure
      } on SpotifyConnectionException catch (e) {
        // Connection failure
      } on SpotifyException catch (e) {
        // General domain exception
      }
      

4. Web Migration to package:web (WASM Ready)

  • What changed: Migrated from legacy dart:html to package:web and dart:js_interop.
  • Migration: No consumer code changes needed. Fully compatible with WebAssembly (--wasm) builds in Flutter 3.47+.

5. Platform Minimums

  • Flutter: >=3.47.1 | Dart: >=3.13.0 <4.0.0
  • Android: minSdk 24, Gradle 9.7+, Kotlin 2.4.10+
  • iOS: Minimum deployment target iOS 15.0+

✨ Features & Improvements #

  • Centralized Bridge Pattern: Introduced PlatformChannelGateway and centralized constants across Dart, Android (SpotifySdkConstants.kt), iOS (SpotifySdkConstants.swift), and Web.
  • Synchronized Event Streams: Full support for all 5 standard event channels across all platforms (player_state, player_context, connection_status, capabilities, user_status).
  • iOS Playback Parity: Added getCrossFadeState, switchToLocalDevice, universal links restoration handler, and enhanced repeat/shuffle control.
  • Web PKCE OAuth: Complete PKCE authorization flow with token refresh and Spotify Web Playback SDK streaming.
  • Code Quality: 100% test coverage for platform delegation & web clients; very_good_analysis strict linting throughout.

4.0.0-dev.8 #

  • FEAT: upgrade to Flutter 3.47.1 and update dependencies (#268).

4.0.0-dev.7 #

  • FEAT(exceptions): introduce structured domain exceptions for Spotify SDK (#265).

4.0.0-dev.6 #

  • FEAT: update to gradle 9 (#261).
  • FEAT: add test coverage report step summary, sticky PR comment, and ign… (#258).

4.0.0-dev.5 #

  • FEAT: release version 4.0.0 with native iOS playback features and improved pub.dev Pana compliance across all packages.

4.0.0-dev.4 #

  • DOCS: align README API tables with true platform support matrices and Dart API method names (getCrossFadeState, switchToLocalDevice).
  • FEAT: update pubspec description for pub.dev Pana compliance and target sub-packages ^4.0.0.
  • REFACTOR: web plugin deepening (#257).

4.0.0-dev.3 #

Note: This release has breaking changes.

  • REFACTOR: introduce PlatformChannelGateway to centralize method chann… (#256).
  • FIX: resolve Web/WASM, SwiftPM and Kotlin scoring warnings on pub.dev (#254).
  • BREAKING FEAT: update all to latest (#251).

4.0.0-dev.2 #

Note: This release has breaking changes.

  • FIX: resolve Web/WASM, SwiftPM and Kotlin scoring warnings on pub.dev (#254).
  • BREAKING FEAT: update all to latest (#251).

4.0.0-dev.1 #

  • BREAKING: Android Zero-Configuration SDK Auto-Download:
    • The plugin now automatically downloads the Spotify App Remote SDK AAR binary during compilation, storing it in a local Maven repository (m2repository) within the plugin folder.
    • The manual dart run spotify_sdk:android_setup command is deprecated and has been removed.
    • Users no longer need to add include ':spotify-app-remote' to their settings.gradle file. Existing users should delete the android/spotify-app-remote folder and remove it from settings.gradle.
  • BREAKING: Spotify Android Auth SDK v5.0.0 Migration:
    • Upgraded to com.spotify.android:auth:5.0.0.
    • Removed support for manifestPlaceholders in build.gradle.
    • Existing and new users must explicitly register com.spotify.sdk.android.auth.browser.RedirectUriReceiverActivity (note the .browser. in the package path) in their AndroidManifest.xml file.
  • Modernization & Code Cleanups:
    • Cleaned up core dependencies by removing legacy setup scripts and their packages (logger and http).
    • Updated to latest Dart and Flutter conventions and best practices:
      • Dart SDK: Updated to ^3.10.0 (was ^3.8.0) - enables modern language features (pattern matching, records, sealed classes).
      • Web Platform: Migrated from dart:html to package:web for modern type-safe browser APIs.
      • Linting: Replaced manual lint configuration with very_good_analysis package.
      • Conventions: Constants now use lowerCamelCase (not UPPER_CASE) per modern Dart conventions.

3.0.2 #

  • chore: update deprications (#224)

3.0.1 #

  • BREAKING: isSpotifyAppActive is removed from iOS and Android (#222) and therefore removed from the sdk
  • chore: Bump native iOS SDK to 3.0.0 (#222)

3.0.0 #

  • All changes from dev builds
  • chore: Bump native iOS SDK to 1.2.4 (#208)
  • chore: Update Spotify iOS SDK to v2.1.7 (#216)
  • chore: Update android versions (#219)

3.0.0-dev.3 #

  • Fix: prevent multiple iOS initializations (#203)
  • Chore: Update libraries (#202)
  • Feat: Automatic setup of the android integration of the spotify_sdk (#204)

3.0.0-dev.2 #

  • Feat: add set podcastPlaybackSpeed and switchToLocalDevice for android (#160)

3.0.0-dev.1 #

  • BREAKING:feat: update spotify.android:auth from 1.2.6 to 2.1.0 and spotify.app.remote from 0.7.2 to 0.8.0 In the app/build.gradle add the following to the default config for auth to work as described here
    defaultConfig {
            manifestPlaceholders = [redirectSchemeName: "spotify-sdk", redirectHostName: "auth"]
            ...
        }
    
  • Update android target sdk to 34

2.3.1 #

  • Fix: null album when getting advertisement on android (#179)
  • Fix: queue endpoint for web (#167)
  • Update license to apache-2.0

2.3.0 #

  • iOS, Android and Web
    • getAuthenticationToken is deprecated in favor of getAccessToken
  • Android:
    • spotify-auth SDK is now retrieved via Maven Central instead of being sourced from an AAR file
      • Steps to remove the spotify-auth SDK:
        • android/settings.gradle -> remove ':spotify-auth'
        • android/spotify-auth/build.gradle -> remove file
        • android/spotify-auth/spotify-auth-release-x.x.x.aar -> remove file

2.2.0 #

  • iOS and Android
    • adds SkipToIndex and getCapabilities
    • adds isSpotifyAppActive
    • adds getLibraryState on iOS
    • Switch to native Spotify iOS XCFramework
    • fixes android json mapping error on release builds
    • fixes skipPrevious on iOS
  • web
    • adds use accessToken which implies reusing _spotifyToken from getAuthenticationToken
    • adds optional tokenSwapURL and tokenRefreshURL for Authorization Code (without PKCE)
    • adds support for track relinking
    • fixes browser autoplay error
  • updates libraries
  • updates documentation

2.1.0 #

  • BREAKING: setShuffle now does not expect a named argument
  • fixes accessToken being ignored in connectToSpotify()
  • exposes spotifyURI on connectToSpotify() method
  • fixes the web implementation not using the authentication scopes supplied by the user
  • fix a crash when calling subscribeToConnectionStatus
  • fix a bug where the webplayer would not dispose
  • add null safety to example app

2.0.0 #

  • BREAKING: opt into null safety
  • upgrade Dart SDK constraints to >=2.12.0-0 <3.0.0

1.0.2 #

  • fixes image dimension exception on getImage

1.0.1 #

  • improves error reporting on iOS
  • supports adding additional scopes for iOS
  • offers option to start radio while connecting to Spotify
  • updates packages

1.0.0 #

  • adds support for iOS 🎉 (thanks fotiDim)
  • adapts to breaking changes in the spotify android sdk (thanks itsMatoosh)
  • implements PKCE auth flow for the web implementation (thanks itsMatoosh)
  • adds the setShuffle() and setRepeatMode() APIs for Android (thanks Joran-Dob)
  • renames logout to disconnect
  • adds accessToken as an optional parameter to connectToSpotifyRemote() (only supported on iOS)
  • some minor bug fixing

0.5.0 #

  • adds support for web (thanks itsMatoosh)
  • adds custom scopes for the web api (thanks arnav-sh)
  • adds logout functionality for android
  • moved from pedantic to lint for static analyses
  • some minor bug fixing

0.3.4 #

  • adds handling of unexpected disconnects from Spotify via subscribeConnectionStatus()-Stream(thanks itsMatoosh)
  • adds usage of .env file for the example project
  • fixes some minor error message issues

0.3.3 #

  • adds getImage to get an Image from any spotifyURI (thanks eddwhite)
  • fixes some minor issues
  • raised dart-sdk version to 2.7.0

0.3.2 #

  • fixes compatibility with spotify-auth dependency above version 1.2.0 (thanks itsMatoosh)
    • spotify introduced some breaking changes: Rename classes from AuthenticationClassName to AuthorizationClassName

0.3.1 #

  • fixes wrong links and incorrect docs

0.3.0 #

  • android user api implementation finished
    • remove from library
    • subscribe to user status
    • subscribe to capabilities
    • get librarystate
  • updated package references

0.2.0 #

  • android player api implementation subscriptions finished
    • subscribe to playerContext and playerState now possible
  • added more instructions for android
  • code refactoring
  • extended the example
  • extended the documentation

0.1.0 #

  • android player api implementation finished
  • error handling finished
  • setup instructions for android finished
  • naming for modules finished

0.0.4 #

  • added instructions for android
  • fixed naming for modules

0.0.3 #

  • added the following implementations for android:
    • getCrossfadeState
    • getPlayerState
  • general refactoring of the native android implementation
  • adds documentation to all methods
  • adds json_annotation: ^3.0.0, build_runner: ^1.0.0, json_serializable: ^3.2.0 to make use of some json serializing functionality for the crossfadeState and PlayerState

0.0.2 #

  • added the following implementations for android:
    • resume
    • skip next
    • skip previous
    • seek to
    • seek to relative
  • splitted remote authorization and token retrieval in two seperate functions
  • implemented the example project
  • added logger package for prettier logs

0.0.1 #

  • Added latests spotify-app-remote (v7.0.0) and spotify-auth (v1.1.0) from https://github.com/spotify/android-sdk/releases
  • finished android native implementation for
    • authorization with token response
    • play
    • pause
    • queue
    • toggleShuffle
    • toggleRepeat
    • addToLibrary