Skip to content

Commit 8c76d44

Browse files
committed
Updates to readme
- added contributors - updated docs
1 parent 5081e77 commit 8c76d44

File tree

6 files changed

+1077
-373
lines changed

6 files changed

+1077
-373
lines changed

.all-contributorsrc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"projectName": "react-native-spotify-remote",
3+
"projectOwner": "cjam",
4+
"repoType": "github",
5+
"repoHost": "https://github.com",
6+
"files": [
7+
"README.md"
8+
],
9+
"imageSize": 100,
10+
"commit": false,
11+
"commitConvention": "none",
12+
"contributors": [
13+
{
14+
"login": "cjam",
15+
"name": "Colter McQuay",
16+
"avatar_url": "https://avatars2.githubusercontent.com/u/1000288?v=4",
17+
"profile": "https://github.com/cjam",
18+
"contributions": [
19+
"code"
20+
]
21+
},
22+
{
23+
"login": "lufinkey",
24+
"name": "Luis Finke",
25+
"avatar_url": "https://avatars3.githubusercontent.com/u/7820113?v=4",
26+
"profile": "https://github.com/lufinkey",
27+
"contributions": [
28+
"ideas"
29+
]
30+
},
31+
{
32+
"login": "YozhikM",
33+
"name": "Stanislav",
34+
"avatar_url": "https://avatars0.githubusercontent.com/u/27273025?v=4",
35+
"profile": "https://github.com/YozhikM",
36+
"contributions": [
37+
"code"
38+
]
39+
}
40+
],
41+
"contributorsPerLine": 7
42+
}

README.md

Lines changed: 78 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,54 @@
11

22
# Spotify App Remote for React Native
33

4-
A react native module for the Spotify Remote SDK.
4+
[![npm version](https://badge.fury.io/js/react-native-spotify-remote.svg)](https://badge.fury.io/js/react-native-spotify-remote)
55

6-
>## ⚠️ Work In Progress ⚠️
7-
8-
>## Currently Only Implemented for iOS
6+
A react native module for the Spotify Remote SDK ( [iOS](https://github.com/spotify/ios-sdk/) | [Android](https://github.com/spotify/android-sdk/) )
97

108
- [Documentation](https://cjam.github.io/react-native-spotify-remote/index.html)
119
- [Change Log](./CHANGELOG.md)
1210
- [Contributing](./CONTRIBUTING.md)
1311

12+
## Supported Features
13+
14+
An [Example](./example) project was developed to exercise and test all functionality within this library. If you are curious about how to use something, or need to compare your application setup to something that works, check there first.
15+
16+
## Features
17+
18+
The following table shows the platform support for various Spotify Remote API functionality within this library.
19+
20+
|Feature|iOS|Android||
21+
|:--|:-:|:-:|-:|
22+
|Authentication|
23+
|`authorize` ||||
24+
|`getSession` ||||
25+
|`endSession` ||||
26+
|Remote|
27+
|`isConnectedAsync` ||||
28+
|`connect` ||||
29+
|`disconnect` ||||
30+
|`playUri` ||||
31+
|`playItem` ||||
32+
|`playItemWithIndex` ||||
33+
|`queueUri` ||||
34+
|`seek` ||||
35+
|`resume` ||||
36+
|`pause` ||||
37+
|`skipToNext` ||||
38+
|`skipToPrevious` ||||
39+
|`setShuffling` ||||
40+
|`setRepeatMode` ||||
41+
|`getPlayerState` ||||
42+
|`getRootContentItems` |||Not available in Android SDK|
43+
|`getRecommendedContentItems` ||||
44+
|`getChildrenOfItem` ||||
45+
|`getContentItemForUri` |||Not available in Android SDK|
46+
|`getCrossfadeState` ||||
47+
|Remote Events|
48+
|`playerStateChanged` ||||
49+
|`remoteDisconnected` ||||
50+
|`remoteConnected` ||||
51+
1452
## Install
1553

1654
```bash
@@ -25,6 +63,8 @@ npm install --save react-native-spotify-remote
2563

2664
## Linking
2765

66+
As of React Native `> 0.61`, auto linking should work for both iOS and Android. There shouldn't be any modifications necessary and it *Should* work out of the box. The one caveat, is that `react-native-events` needs to be linked as it doesn't yet support auto linking. If you do run into issues or are using an older version of React Native, the following sections should help get you up and running.
67+
2868
### iOS
2969

3070
>This library requires being built with **XCode 11** for reasons given [here](https://github.com/spotify/ios-sdk/issues/179#issuecomment-581032275).
@@ -87,106 +127,32 @@ Modifications are needed for the `AppDelegate.m`:
87127
88128
### Android
89129
90-
This project has been configured to support autolinking in `react-native` > 0.60. However, if you need to you can most likely call `react-native link` to link it. If you need to manually set your project up, the [Example](./example) project is there as an example of what is needed to make this library work.
91-
92-
In addition to linking the library into your project, you will also need to add the following code to your
93-
<!--
94-
#### Android
130+
If you need to link your project manually, here are some things you'll need to do.
95131
96-
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
132+
1. Open up `android/app/src/main/java/[...]/MainApplication.java`
97133
- Add `import com.reactlibrary.RNSpotifyRemotePackage;` to the imports at the top of the file
98134
- Add `new RNSpotifyRemotePackage()` to the list returned by the `getPackages()` method
99135
2. Append the following lines to `android/settings.gradle`:
100136
```
101-
include ':react-native-spotify-remote'
102-
project(':react-native-spotify-remote').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-spotify-remote/android')
137+
include ':react-native-spotify-remote'
138+
project(':react-native-spotify-remote').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-spotify-remote/android')
139+
140+
include ':react-native-events'
141+
project(':react-native-events').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-events/android')
103142
```
104143
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
105144
```
106-
compile project(':react-native-spotify-remote')
145+
implementation project(':react-native-spotify-remote')
146+
implementation project(':react-native-events')
107147
```
108148
109-
Edit `android/build.gradle` and add `flatDir`
110-
111-
```
112-
...
113-
allprojects {
114-
repositories {
115-
mavenLocal()
116-
jcenter()
117-
maven {
118-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
119-
url "$rootDir/../node_modules/react-native/android"
120-
}
121-
flatDir {
122-
dirs project(':react-native-spotify-remote').file('libs'), 'libs'
123-
}
124-
}
125-
}
126-
...
127-
```
128-
129-
Edit `android/app/build.gradle` and add `packagingOptions`
130-
131-
```
132-
...
133-
buildTypes {
134-
release {
135-
minifyEnabled enableProguardInReleaseBuilds
136-
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
137-
}
138-
}
139-
packagingOptions {
140-
pickFirst 'lib/armeabi-v7a/libgnustl_shared.so'
141-
pickFirst 'lib/x86/libgnustl_shared.so'
142-
}
143-
...
144-
```
145-
146149
If you have issues linking the module, please check that gradle is updated to the latest version and that your project is synced. -->
147150
148-
## Features
149-
150-
The following table is here to show the support for Spotify Remote API functionality within this library.
151-
152-
|Feature|iOS|Android|
153-
|:--|:-:|:-:|
154-
|Authentication|
155-
|`authorize` |✅|✅|
156-
|`getSession` |✅|✅|
157-
|`endSession` |✅|✅|
158-
|Remote|
159-
|`isConnectedAsync` |✅|✅|
160-
|`connect` |✅|✅|
161-
|`disconnect` |✅|✅|
162-
|`playUri` |✅|✅|
163-
|`playItem` |✅|✅|
164-
|`playItemWithIndex` |✅|✅|
165-
|`queueUri` |✅|✅|
166-
|`seek` |✅|✅|
167-
|`resume` |✅|✅|
168-
|`pause` |✅|✅|
169-
|`skipToNext` |✅|✅|
170-
|`skipToPrevious` |✅|✅|
171-
|`setShuffling` |✅|✅|
172-
|`setRepeatMode` |✅|✅|
173-
|`getPlayerState` |✅|✅|
174-
|`getRootContentItems` |✅|❌|
175-
|`getRecommendedContentItems` |✅|✅|
176-
|`getChildrenOfItem` |✅|✅|
177-
|`getContentItemForUri` |✅|❌|
178-
|`getCrossfadeState` |✅|✅|
179-
|Remote Events|
180-
|`playerStateChanged` |✅|❌|
181-
|`remoteDisconnected` |✅|✅|
182-
|`remoteConnected` |✅|✅|
183-
184-
185151
## Usage
186152
187153
### Example Application
188154
189-
This repo contains an [Example App](./example/Readme.md) which should be the quickest and easiest way to get up and running to try things out. It is using React Hooks (cuz they're pretty cool) and is using a few of the remote API calls. (Will be looking to show use of all of the api calls in the near future).
155+
This repo contains an [Example App](./example/Readme.md) which should be the quickest and easiest way to get up and running to try things out. It is using React Hooks (cuz they're pretty cool) and exercises all of the remote API calls.
190156
191157
### In Code
192158
@@ -208,15 +174,15 @@ const spotifyConfig: ApiConfig = {
208174
redirectURL: "SPOTIFY_REDIRECT_URL",
209175
tokenRefreshURL: "SPOTIFY_TOKEN_REFRESH_URL",
210176
tokenSwapURL: "SPOTIFY_TOKEN_SWAP_URL",
211-
scope: ApiScope.AppRemoteControlScope | ApiScope.UserFollowReadScope
177+
scopes: [ApiScope.AppRemoteControlScope, ApiScope.UserFollowReadScope]
212178
}
213179
214180
// Initialize the library and connect the Remote
215181
// then play an epic song
216182
async function playEpicSong(){
217183
try{
218-
const token = await SpotifyAuth.initialize(spotifyConfig);
219-
await SpotifyRemote.connect(token);
184+
const session = await SpotifyAuth.authorize(spotifyConfig);
185+
await SpotifyRemote.connect(session.token);
220186
await remote.playUri("spotify:track:6IA8E2Q5ttcpbuahIejO74");
221187
await remote.seek(58000);
222188
}catch(err){
@@ -241,6 +207,25 @@ Nothing has been special to deal with Spotify *Free* Users but this module _shou
241207

242208
Please do not open issues about getting the module to work unless you have tried using both the example app and the example token swap server. Please make sure you have tried running on the latest react-native version before submitting a bug.
243209

244-
## Acknowledgements
210+
## Contributors
211+
212+
Big thanks to [@lufinkey](https://github.com/lufinkey) and all of the great work that he has done in the [react-native-spotify](https://github.com/lufinkey/react-native-spotify) repo which was the original source of inspiration and some useful patterns for this package.
213+
214+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
215+
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
216+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
217+
218+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
219+
<!-- prettier-ignore-start -->
220+
<!-- markdownlint-disable -->
221+
<table>
222+
<tr>
223+
<td align="center"><a href="https://github.com/cjam"><img src="https://avatars2.githubusercontent.com/u/1000288?v=4" width="100px;" alt=""/><br /><sub><b>Colter McQuay</b></sub></a><br /><a href="https://github.com/cjam/react-native-spotify-remote/commits?author=cjam" title="Code">💻</a></td>
224+
<td align="center"><a href="https://github.com/lufinkey"><img src="https://avatars3.githubusercontent.com/u/7820113?v=4" width="100px;" alt=""/><br /><sub><b>Luis Finke</b></sub></a><br /><a href="#ideas-lufinkey" title="Ideas, Planning, & Feedback">🤔</a></td>
225+
<td align="center"><a href="https://github.com/YozhikM"><img src="https://avatars0.githubusercontent.com/u/27273025?v=4" width="100px;" alt=""/><br /><sub><b>Stanislav</b></sub></a><br /><a href="https://github.com/cjam/react-native-spotify-remote/commits?author=YozhikM" title="Code">💻</a></td>
226+
</tr>
227+
</table>
245228

246-
Big thanks to [@lufinkey](https://github.com/lufinkey) and all of the great work that he has done in the [react-native-spotify](https://github.com/lufinkey/react-native-spotify) repo which was the original source of inspiration & coding patterns for this package.
229+
<!-- markdownlint-enable -->
230+
<!-- prettier-ignore-end -->
231+
<!-- ALL-CONTRIBUTORS-LIST:END -->

0 commit comments

Comments
 (0)