Skip to content

Commit

Permalink
redirect URi for trackActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrence Onodipe committed Apr 21, 2024
1 parent 2937ca2 commit 1e024ed
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
import com.example.spotifywrapped2340.SpotifyDataManagers.SpotifyManager;

import jp.shts.android.storiesprogressview.StoriesProgressView; import com.example.spotifywrapped2340.SpotifyDataManagers.SpotifyManager;
import com.spotify.android.appremote.api.*;
import com.spotify.android.appremote.api.ConnectionParams;
import com.spotify.android.appremote.api.Connector;
import com.spotify.android.appremote.api.SpotifyAppRemote;
import com.spotify.android.appremote.api.SpotifyAppRemote;import com.spotify.android.appremote.api.ConnectionParams;



public class TracksActivity extends AppCompatActivity implements StoriesProgressView.StoriesListener{
Expand Down Expand Up @@ -46,6 +48,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

ConnectionParams connectionParams =
new ConnectionParams.Builder("3f2eac4dbbb0498194d8b5d955949c1a")
.setRedirectUri("spotify-wrapped-2340://auth")
.showAuthView(true)
.build();
SpotifyAppRemote.connect(this, connectionParams, new Connector.ConnectionListener() {
Expand All @@ -54,10 +57,8 @@ public void onConnected(@NonNull SpotifyAppRemote spotifyAppRemote) {
obj = spotifyAppRemote;
Log.d("MainActivity", "Connected to Spotify!");

// Now you can use mSpotifyAppRemote to control playback, etc.
playTrack("spotify:track:4uLU6hMCjMI75M1A2tKUQC");
}

@Override
public void onFailure(Throwable error) {
Log.e("MainActivity", "Failed to connect to Spotify", error);
Expand Down

0 comments on commit 1e024ed

Please sign in to comment.