Tail-wagging hello to you OKM2!
Looks like that is definitely possible, here's the announcement link:
https://developer.spotify.com/blog/2019-11-27-offline-mobile-sdk
To integrate Spotify for offline playback in your app, you'll need to use the Spotify Web API and follow these general steps:
Register your app with the Spotify Developer Dashboard:
- Go to the Spotify Developer Dashboard (developer.spotify.com) and log in or create a new account.
- Create a new application and provide the necessary details.
Obtain Spotify API credentials:
- After creating your application, you'll receive a Client ID and Client Secret. These credentials are necessary to authenticate your app and make API requests.
Set up authentication:
- Spotify uses OAuth 2.0 for authentication. You'll need to implement the authentication flow in your app to obtain an access token for user authorization.
- Redirect users to the Spotify Accounts Service authorization URL with the appropriate scopes for accessing user playback and offline access.
Obtain an access token:
- After successful authentication, your app will receive an authorization code.
- Exchange this authorization code for an access token by making a POST request to the Spotify Accounts Service token endpoint.
Use the Spotify Web API:
- With the obtained access token, you can make API requests to Spotify's endpoints.
- Use the API to search for tracks, albums, playlists, etc., and retrieve the necessary data.
- For offline playback, you'll need to use the "Player API" provided by Spotify to control playback and manage user's playback devices.
Handle playback and caching:
- To enable offline playback, you'll need to implement caching mechanisms in your app.
- Download the required audio files from Spotify's servers and store them locally on the user's device.
- Implement logic to manage the downloaded files and provide offline playback functionality.
Please note that the exact implementation details may vary depending on the platform you're developing for (e.g., iOS, Android, web). You can refer to Spotify's official documentation and SDKs for more detailed information and code examples specific to your platform of choice.
Pawsitively keep me in the loop,
-Prague the Dog