From a1a8996c8e7cf791aaf17dc1ec8efe963eb7a0c4 Mon Sep 17 00:00:00 2001 From: tobika Date: Mon, 2 Nov 2020 11:24:00 +0100 Subject: [PATCH 1/3] update to spotify auth 1.2.3 --- src/android/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/android/build.gradle b/src/android/build.gradle index f9cdf1c..054612e 100644 --- a/src/android/build.gradle +++ b/src/android/build.gradle @@ -6,7 +6,7 @@ repositories { } dependencies { - compile 'com.spotify.android:auth:1.0.0-alpha' + implementation 'com.spotify.android:auth:1.2.3' } android { @@ -14,4 +14,4 @@ android { exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' } -} \ No newline at end of file +} From b4a59978baaa9334940d8980d635c241fc5d366f Mon Sep 17 00:00:00 2001 From: tobika Date: Mon, 2 Nov 2020 11:26:43 +0100 Subject: [PATCH 2/3] fix renamed classes from Authentication to Authorization --- src/android/SpotifyOAuthPlugin.java | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/android/SpotifyOAuthPlugin.java b/src/android/SpotifyOAuthPlugin.java index 3480256..3e9b618 100644 --- a/src/android/SpotifyOAuthPlugin.java +++ b/src/android/SpotifyOAuthPlugin.java @@ -7,7 +7,9 @@ import org.apache.cordova.*; import org.json.*; -import com.spotify.sdk.android.authentication.*; +import com.spotify.sdk.android.auth.AuthorizationClient; +import com.spotify.sdk.android.auth.AuthorizationRequest; +import com.spotify.sdk.android.auth.AuthorizationResponse; public class SpotifyOAuthPlugin extends CordovaPlugin { private static final int LOGIN_REQUEST_CODE = 8139; @@ -16,7 +18,7 @@ public class SpotifyOAuthPlugin extends CordovaPlugin { private CallbackContext currentCtx = null; @Override - public boolean execute(String action, JSONArray args, CallbackContext ctx) + public boolean execute(String action, JSONArray args, CallbackContext ctx) throws JSONException { if ("getCode".equals(action)) { String clientId = args.getString(0); @@ -31,26 +33,26 @@ public boolean execute(String action, JSONArray args, CallbackContext ctx) } private void getCode( - final String clientId, - final String redirectUrl, + final String clientId, + final String redirectUrl, final String[] scopes, final CallbackContext ctx ) { cordova.setActivityResultCallback(this); this.currentCtx = ctx; - AuthenticationRequest ab = (new AuthenticationRequest.Builder( + AuthorizationRequest ab = (new AuthorizationRequest.Builder( clientId, - AuthenticationResponse.Type.CODE, + AuthorizationResponse.Type.CODE, redirectUrl )) .setScopes(scopes) .setShowDialog(true) .build(); - AuthenticationClient.openLoginActivity( - this.cordova.getActivity(), - LOGIN_REQUEST_CODE, + AuthorizationClient.openLoginActivity( + this.cordova.getActivity(), + LOGIN_REQUEST_CODE, ab ); } @@ -69,8 +71,8 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) { return; } - final AuthenticationResponse response = AuthenticationClient.getResponse(resultCode, intent); - if (response.getType() == AuthenticationResponse.Type.CODE) { + final AuthorizationResponse response = AuthorizationClient.getResponse(resultCode, intent); + if (response.getType() == AuthorizationResponse.Type.CODE) { JSONObject res = new JSONObject(); try { res.put("code", response.getCode()); @@ -79,7 +81,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) { } cb.success(res); } else { - JSONObject err = response.getType() == AuthenticationResponse.Type.EMPTY ? + JSONObject err = response.getType() == AuthorizationResponse.Type.EMPTY ? this.makeError( "auth_canceled", "The user cancelled the authentication process." @@ -89,7 +91,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) { ); cb.error(err); } - + this.currentCtx = null; } @@ -116,4 +118,4 @@ private static String[] toStringArray(JSONArray arr) { } return res; } -} \ No newline at end of file +} From 328c3f261ea319da356d57ba9806091f4f11dc2f Mon Sep 17 00:00:00 2001 From: Tobias Kausch Date: Thu, 30 Oct 2025 17:44:57 +0100 Subject: [PATCH 3/3] fix build error (needs node 16) --- www/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/www/tsconfig.json b/www/tsconfig.json index bbfc040..235560f 100644 --- a/www/tsconfig.json +++ b/www/tsconfig.json @@ -12,6 +12,7 @@ "strictNullChecks": true, "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": false, + "skipLibCheck": true, "experimentalDecorators": true }, "exclude": [