Skip to content

Commit

Permalink
updates to 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
brim-borium committed Dec 9, 2019
1 parent ec63a10 commit 776cd8a
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 16 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 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
Expand Down
65 changes: 51 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,92 @@
# spotify_sdk
[![](https://img.shields.io/badge/licence-MIT-blue.svg)](https://github.com/IamTobi/spotify_sdk/blob/master/LICENSE)
[![](https://img.shields.io/badge/pub-v0.1.0-blueviolet.svg)](https://pub.dev/packages/spotify_sdk)

[![licence](https://img.shields.io/badge/licence-MIT-blue.svg)](https://github.com/IamTobi/spotify_sdk/blob/master/LICENSE)
[![pub package](https://img.shields.io/badge/pub-0.2.0-orange)](https://pub.dev/packages/spotify_sdk)

## Description

This will be a spotify_sdk package for flutter using both the spotify-app-remote sdk and spotify-auth library. The auth library is needed to get the authentication token to work with the web api.
This will be a spotify_sdk package for flutter using both the spotify-app-remote sdk and spotify-auth library. The auth library is needed to get the authentication token to work with the web api.

## Setup

### Android

From the [Spotify Android SDK Quick Start](https://developer.spotify.com/documentation/android/quick-start/). You need two things:

1. register your app in the [spotify developer portal](https://developer.spotify.com/dashboard/). You also need to create a sha-1 fingerprint and add this and your package name to the app settings on the dashboard.
1. register your app in the [spotify developer portal](https://developer.spotify.com/dashboard/). You also need to create a sha-1 fingerprint and add this and your package name to the app settings on the dashboard as well as a redirect url.
2. download the current [Spotify Android SDK](https://github.com/spotify/android-sdk/releases). Here you need the spotify-app-remote-*.aar and spotify-auth-*.aar.

After you are all setup you need to add the *.aar files to your Android Project as Modules. See the [Spotify Android SDK Quick Start](https://developer.spotify.com/documentation/android/quick-start/) for detailed information.

Important here is the naming so that the package can find the modules.

- Remote: spotify-app-remote
- Auth: spotify-auth


## Usage

tbd
To start using this package you first have to connect to Spotify. To only connect you can do this with connectToSpotifyRemote(...) or getAuthenticationToken(...) in both of these methods you need the client id, given in the spotify dashboard and the redirect url you set in the settings on the dashboard.

```dart
await SpotifySdk.connectToSpotifyRemote(clientId: "", redirectUrl: "")
```

If you want to use the web api aswell you have to use this method to get the authentication token.

```dart
var authenticationToken = await SpotifySdk.getAuthenticationToken(clientId: "", redirectUrl: "");
```

tbd...

### Api

#### Connecting/Authenticating

| Function | Description| Android | iOS |
|---|---|---|--|
| connectToSpotifyRemote | Connects the App to Spotify | :heavy_check_mark: | :construction_worker: |
| getAuthenticationToken | Gets the Authentication Token that you can use to work with the [Web Api](https://developer.spotify.com/documentation/web-api/) |:heavy_check_mark: | :construction_worker: |
| queue | Queues given spotifyUri |:heavy_check_mark: | :construction_worker: |
| play | Plays the given spotifyUri |:heavy_check_mark: | :construction_worker: |
| logout | logs the user out and disconnects the app connection |:construction_worker: | :construction_worker: |

#### Player Api

| Function | Description| Android | iOS |
|---|---|---|--|
| getCrossfadeState | Gets the current crossfade state |:heavy_check_mark: | :construction_worker: |
| getPlayerState | Gets the current player state |:heavy_check_mark: | :construction_worker: |
| pause | Pauses the current track |:heavy_check_mark: | :construction_worker: |
| play | Plays the given spotifyUri |:heavy_check_mark: | :construction_worker: |
| queue | Queues given spotifyUri |:heavy_check_mark: | :construction_worker: |
| resume | Resumes the current track |:heavy_check_mark: | :construction_worker: |
| skipNext | Skips to next track | :heavy_check_mark: | :construction_worker: |
| skipPrevious | Skips to previous track |:heavy_check_mark: | :construction_worker: |
| seekTo | Seeks the current track to the given position in milliseconds | :heavy_check_mark: |:construction_worker: | |
| seekTo | Seeks the current track to the given position in milliseconds | :heavy_check_mark: |:construction_worker: |
| seekToRelativePosition | Adds to the current position of the track the given milliseconds |:heavy_check_mark: | :construction_worker: |
| subscribeToPlayerContext | Subscribes to the current player context |:heavy_check_mark:|:construction_worker: |
| subscribeToPlayerState| Subscribes to the current player state |:heavy_check_mark: |:construction_worker:|
| getCrossfadeState | Gets the current crossfade state |:heavy_check_mark: | :construction_worker: |
| toggleShuffle | Cycles through the shuffle modes |:heavy_check_mark: | :construction_worker: |
| toggleRepeat | Cycles through the repeat modes | :heavy_check_mark: | :construction_worker: |
| addToLibrary | Adds the given spotifyUri to the users library |:heavy_check_mark: | :construction_worker: |
| getCrossfadeState | Gets the current crossfade state |:heavy_check_mark: | :construction_worker: |
| getPlayerState | Gets the current player state |:heavy_check_mark: | :construction_worker: |

#### Images Api

| Function | Description| Android | iOS |
|---|---|---|--|
| getImage | Get the image from the given spotifyUri |:construction_worker: | :construction_worker: |
| logout | logs the user out and disconnects the app connection |:construction_worker: | :construction_worker: |

#### User Api

| Function | Description| Android | iOS |
|---|---|---|--|
| addToLibrary | Adds the given spotifyUri to the users library |:heavy_check_mark: | :construction_worker: |
| getCapabilities | tbd |:construction_worker: | :construction_worker: |
| getLibraryState | tbd |:construction_worker: | :construction_worker: |
| removeFromLibrary | tbd |:construction_worker: | :construction_worker: |
| subscribeToCapabilities | tbd |:construction_worker: | :construction_worker: |
| subscribeToUserStatus | tbd |:construction_worker: | :construction_worker: |

## Docs
## Official Spotify Docs

- [Auth](https://spotify.github.io/android-sdk/auth-lib/docs/index.html)
- [App Remote](https://spotify.github.io/android-sdk/app-remote-lib/docs/index.html)
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.1.0"
version: "0.2.0"
stack_trace:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: spotify_sdk
description: A flutter plugin that let's you communicate with the flutter sdk
version: 0.1.0
version: 0.2.0
homepage: https://github.com/brim-borium/spotify_sdk
issue_tracker: https://github.com/brim-borium/spotify_sdk/issues

Expand Down

0 comments on commit 776cd8a

Please sign in to comment.