@superfan-app/spotify-auth 0.1.79 → 0.1.80
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/package.json +1 -1
- package/plugin/build/index.js +10 -2
- package/plugin/src/index.ts +10 -4
package/package.json
CHANGED
package/plugin/build/index.js
CHANGED
|
@@ -111,8 +111,16 @@ const withSpotifyAndroidManifest = (config, props) => {
|
|
|
111
111
|
if (!mainActivity['intent-filter']) {
|
|
112
112
|
mainActivity['intent-filter'] = [];
|
|
113
113
|
}
|
|
114
|
-
// Check if we already have
|
|
115
|
-
|
|
114
|
+
// Check if we already have an intent filter covering the Spotify redirect.
|
|
115
|
+
// A broad scheme-only filter (no android:host) already covers superfan://callback,
|
|
116
|
+
// so we must treat it as sufficient to avoid registering two overlapping filters
|
|
117
|
+
// (which causes Android to show the app twice in the disambiguation dialog).
|
|
118
|
+
const hasSpotifyIntentFilter = mainActivity['intent-filter'].some((filter) => filter.data?.some((d) => {
|
|
119
|
+
const scheme = d.$?.['android:scheme'];
|
|
120
|
+
const host = d.$?.['android:host'];
|
|
121
|
+
// Matches if same scheme + matching host, OR same scheme with no host restriction
|
|
122
|
+
return scheme === props.scheme && (!host || host === callbackHost);
|
|
123
|
+
}));
|
|
116
124
|
if (!hasSpotifyIntentFilter) {
|
|
117
125
|
// Build the data element: android:host must be the hostname only (no path).
|
|
118
126
|
// If the callback has a path component (e.g. "auth/spotify"), add android:pathPrefix.
|
package/plugin/src/index.ts
CHANGED
|
@@ -128,12 +128,18 @@ const withSpotifyAndroidManifest: ConfigPlugin<SpotifyConfig> = (config, props)
|
|
|
128
128
|
mainActivity['intent-filter'] = [];
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
// Check if we already have
|
|
131
|
+
// Check if we already have an intent filter covering the Spotify redirect.
|
|
132
|
+
// A broad scheme-only filter (no android:host) already covers superfan://callback,
|
|
133
|
+
// so we must treat it as sufficient to avoid registering two overlapping filters
|
|
134
|
+
// (which causes Android to show the app twice in the disambiguation dialog).
|
|
132
135
|
const hasSpotifyIntentFilter = mainActivity['intent-filter'].some(
|
|
133
136
|
(filter: any) =>
|
|
134
|
-
filter.data?.some(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
filter.data?.some((d: any) => {
|
|
138
|
+
const scheme = d.$?.['android:scheme'];
|
|
139
|
+
const host = d.$?.['android:host'];
|
|
140
|
+
// Matches if same scheme + matching host, OR same scheme with no host restriction
|
|
141
|
+
return scheme === props.scheme && (!host || host === callbackHost);
|
|
142
|
+
})
|
|
137
143
|
);
|
|
138
144
|
|
|
139
145
|
if (!hasSpotifyIntentFilter) {
|