@wwdrew/expo-spotify-sdk 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ android {
|
|
|
80
80
|
spotifyRedirectUri: "myapp://spotify-auth",
|
|
81
81
|
redirectSchemeName: "myapp",
|
|
82
82
|
redirectHostName: "spotify-auth",
|
|
83
|
-
redirectPathPattern: "
|
|
83
|
+
redirectPathPattern: ".*"
|
|
84
84
|
]
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -107,16 +107,23 @@ export default {
|
|
|
107
107
|
clientID: "your-spotify-client-id",
|
|
108
108
|
scheme: "myapp",
|
|
109
109
|
host: "spotify-auth",
|
|
110
|
-
// Optional: path pattern accepted by the Spotify Android SDK redirect.
|
|
111
|
-
// Defaults to "/.*" (matches any path). Change this only if you have a
|
|
112
|
-
// specific redirect path registered in your Spotify app settings.
|
|
113
|
-
redirectPathPattern: "/.*",
|
|
114
110
|
},
|
|
115
111
|
],
|
|
116
112
|
],
|
|
117
113
|
};
|
|
118
114
|
```
|
|
119
115
|
|
|
116
|
+
`redirectPathPattern` is optional and defaults to `".*"`, which matches every redirect URI shape Spotify will hand back. Only set it if you have a specific path registered in your Spotify app settings:
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
{
|
|
120
|
+
clientID: "your-spotify-client-id",
|
|
121
|
+
scheme: "myapp",
|
|
122
|
+
host: "spotify-auth",
|
|
123
|
+
redirectPathPattern: "/auth/.*",
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
120
127
|
### Plugin options
|
|
121
128
|
|
|
122
129
|
| Option | Type | Required | Description |
|
|
@@ -124,7 +131,7 @@ export default {
|
|
|
124
131
|
| `clientID` | `string` | ✅ | Your Spotify application's Client ID |
|
|
125
132
|
| `scheme` | `string` | ✅ | URL scheme registered for your app (e.g. `"myapp"`) |
|
|
126
133
|
| `host` | `string` | ✅ | Host component of the redirect URI (e.g. `"spotify-auth"`) |
|
|
127
|
-
| `redirectPathPattern` | `string` | — | Android redirect path regex. Defaults to `"
|
|
134
|
+
| `redirectPathPattern` | `string` | — | Android redirect path regex. Defaults to `".*"` |
|
|
128
135
|
|
|
129
136
|
The redirect URI registered in your [Spotify Developer Dashboard](https://developer.spotify.com/dashboard) must match `{scheme}://{host}` exactly (e.g. `myapp://spotify-auth`).
|
|
130
137
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withSpotifyAndroidAppBuildGradle = void 0;
|
|
4
4
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
5
|
const SENTINEL_KEY = "spotifyClientId";
|
|
6
|
-
const DEFAULT_REDIRECT_PATH_PATTERN = "
|
|
6
|
+
const DEFAULT_REDIRECT_PATH_PATTERN = ".*";
|
|
7
7
|
const withSpotifyAndroidAppBuildGradle = (config, spotifyConfig) => {
|
|
8
8
|
return (0, config_plugins_1.withAppBuildGradle)(config, (config) => {
|
|
9
9
|
if (config.modResults.contents.includes(SENTINEL_KEY)) {
|
package/plugin/build/types.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type SpotifyScopes = "ugc-image-upload" | "user-read-playback-state" | "u
|
|
|
15
15
|
* clientID: "<spotify-client-id>",
|
|
16
16
|
* scheme: "myapp",
|
|
17
17
|
* host: "spotify-auth",
|
|
18
|
-
* redirectPathPattern: "
|
|
18
|
+
* redirectPathPattern: ".*"
|
|
19
19
|
* }]
|
|
20
20
|
* ]
|
|
21
21
|
* }
|
|
@@ -32,8 +32,11 @@ export interface SpotifyConfig {
|
|
|
32
32
|
scheme: string;
|
|
33
33
|
/**
|
|
34
34
|
* Path pattern Spotify will accept on the redirect URI. Required by the
|
|
35
|
-
* Spotify Android Auth SDK from version 3.0.0 onwards. Defaults to `"
|
|
36
|
-
* which matches any path
|
|
35
|
+
* Spotify Android Auth SDK from version 3.0.0 onwards. Defaults to `".*"`
|
|
36
|
+
* which matches any path including the empty string, so it works for both
|
|
37
|
+
* `scheme://host` and `scheme://host/path` redirect URIs. Use a more
|
|
38
|
+
* specific pattern (e.g. `"/auth/.*"`) only if you have a specific path
|
|
39
|
+
* registered in your Spotify app settings.
|
|
37
40
|
*
|
|
38
41
|
* See: https://developer.android.com/guide/topics/manifest/data-element#path
|
|
39
42
|
*/
|