I am trying to authenticate a flutter application against Spotify.
For this, I use the flutter_web_auth package. I have a button to authenticate against Spotify.
Once user clicks the button, the following function operates:
onPressed: () async {
final spotifyAuthURL = Uri.https(
'accounts.spotify.com',
'/authorize',
{
'response_type': 'code',
'client_id': dotenv.get('SPOTIFY_CLIENT_ID'),
'redirect_uri':
'https://vinyl_app_spotify.com/callback',
'scope': 'user-read-private user-read-email',
},
);
final result = await FlutterWebAuth.authenticate(
url: spotifyAuthURL.toString(),
callbackUrlScheme:
'https://vinyl_app_spotify.com/callback',
);
},
I've also added the following activiy to the AndroidManifest.xml file as I should have done according to the flutter_web_auth package:
<activity android:name="com.linusu.flutter_web_auth.CallbackActivity" >
<intent-filter android:label="flutter_web_auth">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https://vinyl_app_spotify.com/callback" />
</intent-filter>
</activity>
So after I click my application button, I do get access to Spotify, then the redirect url kicks in, but I just see this:

So my android emulator could not capture the callback url.
What is my mistake? Any advice..