Skip to content

Commit

Permalink
Merge pull request #205 from spotify/auth-1.2.3
Browse files Browse the repository at this point in the history
Bum auth-lib and update keystore configuration in sample-auth
  • Loading branch information
mdelolmo authored Feb 4, 2020
2 parents 337c496 + a1d9fdb commit cf06a97
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app-remote-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ description = 'Public App Remote SDK demo app'
*/

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {

Expand Down
4 changes: 4 additions & 0 deletions auth-lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Change Log
==========
## Version 1.2.3
* Stability fixes on WebView based auth
* Set LoginActivity launch mode to CLEAR_TOP but not SINGLE_TOP, so the activity will be recreated

## Version 1.2.2
* Remove custom-tabs handling due to issues

Expand Down
2 changes: 1 addition & 1 deletion auth-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ that can subsequently be used to play music or in requests to the [Spotify Web A
To add this library to your project add the reference to its `build.gradle` file:

```gradle
implementation 'com.spotify.android:auth:1.2.2'
implementation 'com.spotify.android:auth:1.2.3'
```

To learn more about working with authentication see the
Expand Down
17 changes: 15 additions & 2 deletions auth-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ android {
buildToolsVersion androidBuildTools
compileSdkVersion androidCompileSdk.toString().toInteger()

signingConfigs {
debug {
storeFile file('keystore/example.keystore')
storePassword 'example'
keyAlias 'example_alias'
keyPassword 'example'
}
}

defaultConfig {
applicationId "com.spotify.sdk.android.authentication.sample"

Expand All @@ -39,6 +48,10 @@ android {
}

buildTypes {
debug {
debuggable true
signingConfig signingConfigs.debug
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
Expand All @@ -61,8 +74,8 @@ android {
}

dependencies {
//implementation files('../auth-lib/spotify-auth-release-1.2.2.aar') // Optional as local aar file dependency
implementation 'com.spotify.android:auth:1.2.2' // Maven dependency
//implementation files('../auth-lib/spotify-auth-release-1.2.3.aar') // Optional as local aar file dependency
implementation 'com.spotify.android:auth:1.2.3' // Maven dependency
implementation "androidx.appcompat:appcompat:$appCompatVersion"
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.3'
Expand Down
Binary file added auth-sample/keystore/example.keystore
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ private AuthorizationRequest getAuthenticationRequest(AuthorizationResponse.Type
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
final AuthorizationResponse response = AuthorizationClient.getResponse(resultCode, data);

if (response.getError() != null && response.getError().isEmpty()) {
setResponse(response.getError());
}
if (requestCode == AUTH_TOKEN_REQUEST_CODE) {
mAccessToken = response.getAccessToken();
updateTokenView();
Expand All @@ -138,12 +140,9 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
}

private void setResponse(final String text) {
runOnUiThread(new Runnable() {
@Override
public void run() {
final TextView responseView = findViewById(R.id.response_text_view);
responseView.setText(text);
}
runOnUiThread(() -> {
final TextView responseView = findViewById(R.id.response_text_view);
responseView.setText(text);
});
}

Expand Down

0 comments on commit cf06a97

Please sign in to comment.