https://github.com/afrazcodes/spotifykit
Apple framework for Spotify Authentication & Interacting with Services
https://github.com/afrazcodes/spotifykit
audio ios spotify swift
Last synced: about 2 months ago
JSON representation
Apple framework for Spotify Authentication & Interacting with Services
- Host: GitHub
- URL: https://github.com/afrazcodes/spotifykit
- Owner: AfrazCodes
- License: mit
- Created: 2022-03-05T22:56:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-05T23:39:01.000Z (over 4 years ago)
- Last Synced: 2024-12-01T15:43:02.533Z (over 1 year ago)
- Topics: audio, ios, spotify, swift
- Language: Swift
- Homepage: https://developer.spotify.com/documentation/web-playback-sdk/reference/
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SpotifyKit
iOS Library to authenticate and interact with Spotify services.
## Install
You can integrate this framework via Cocoapods.
```swift
pod 'Spotify-Kit'
```
## Features
- Spotify OAuth Support: Log In, Refresh Token, Persist Credentials Securely
- Fetch Albums
- Fetch Artists
- Fetch Playlists
- Search Content
- Get User Specific Top Content (artists, tracks, playlists)
- Get New Releases
- Update/Create/Delete content in user library (auth required)
- Get Top Charts & Trending Content
- More 🚀
## Usage
1. Configure the SDK via the singleton's configure method.
```swift
let config = SpotifyKitConfiguration(...)
SpotifyAuthManager.shared.configure(config)
```
2. Leverage auth APIs to authenticate a user and obtain OAuth credentials.
3. Make calls against SpotifyAPIManager. The library handles creation of signed/authenticated requests for you.
```swift
// Fetch a users top streamed tracks of all time
SpotifyAPIManager.shared.getTopContent(
.tracks,
for: .lifetime
) { result in
switch result {
case .success(let tracks):
for track in tracks {
print(track.name)
print(track.artist)
print(track.preview_url)
// ...
}
csae .failure(let error):
print(error.localizedDescription)
break
}
}
```