android-sdk icon indicating copy to clipboard operation
android-sdk copied to clipboard

AppRemote Connecting Issues on OS 11+

Open benlane2003 opened this issue 4 years ago • 0 comments

Issue found on OS-11 and above

SDK Version: 0.7.2

OS Version: 11

Expected behaviour: For a while now, on OS 10 and below, our app has never really had a problem connecting to the Spotify APP via the Spotify Android SDK's AppRemote.

Actual behaviour: On OS11 and above, when attempting to connect the same way, the AppRemote fails to connect and results in this error: Explicit user authorization is required to use Spotify. The user has to complete the auth-flow to allow the app to use Spotify on their behalf

We have updated the AppRemote to the lastest (0.7.2) and it still happens.

Included below is the block of code used to connect to the Spotify AppRemote.

SendUnityMessage("SDK Debug: Initialize Called");
            ConnectionParams connectionParams =
                    new ConnectionParams.Builder(CLIENT_ID)
                            .setRedirectUri(REDIRECT_URI)
                            .showAuthView(true)
                            .build();

            SendUnityMessage("SDK Debug: ConnectionParams Made");
            SpotifyAppRemote.connect(unityContext, connectionParams,
                    new Connector.ConnectionListener()
                    {
                        public void onConnected(SpotifyAppRemote spotifyAppRemote)
                        {
                            SendUnityMessage("SDK Debug: onConnected Hit");
                            mSpotifyAppRemote = spotifyAppRemote;
                            mSpotifyAppRemotePlayerAPI = mSpotifyAppRemote.getPlayerApi();
                            SendUnityMessage("SDK Debug: Connected! Yay!");

                            // Now you can start interacting with App Remote
                            //connected();
                        }

                        public void onFailure(Throwable throwable) {
                            SendUnityMessage("SDK Debug: onFailure hit: " + throwable.getMessage());
                            // Something went wrong when attempting to connect! Handle errors here
                        }
                    });

benlane2003 avatar Dec 02 '21 23:12 benlane2003