Skip to content

Commit e72ea94

Browse files
committed
adding in changes so that this will work with api 30
1 parent 0efc925 commit e72ea94

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

library/build.gradle

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ group = GROUP
3232
archivesBaseName = POM_ARTIFACT_ID
3333

3434
android {
35-
compileSdkVersion 28
35+
compileSdkVersion 30
3636

3737
defaultConfig {
3838
versionCode 1
3939
versionName VERSION_NAME
4040
minSdkVersion 21
41-
targetSdkVersion 28
41+
targetSdkVersion 30
4242
}
4343

4444
// Related to https://github.com/scribejava/scribejava/issues/480
@@ -90,18 +90,18 @@ ext {
9090
}
9191

9292
dependencies {
93-
api "androidx.appcompat:appcompat:1.0.2"
94-
api 'com.codepath.libraries:asynchttpclient:0.0.8'
93+
api "androidx.appcompat:appcompat:1.3.0"
94+
api 'com.codepath.libraries:asynchttpclient:2.1.1'
9595
api 'com.github.scribejava:scribejava-apis:4.1.1'
9696
api 'com.github.scribejava:scribejava-httpclient-okhttp:4.1.1'
9797
implementation 'se.akerfeldt:okhttp-signpost:1.1.0'
9898
implementation 'oauth.signpost:signpost-core:1.2.1.2'
9999
implementation 'com.facebook.stetho:stetho:1.5.1'
100100
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.1'
101-
implementation "com.squareup.okhttp3:logging-interceptor:4.1.0"
101+
implementation "com.squareup.okhttp3:logging-interceptor:4.7.2"
102102

103103
}
104104

105-
/*task jar(type: Jar) {
105+
task jar(type: Jar) {
106106
from android.sourceSets.main.java.srcDirs
107-
}*/
107+
}

library/src/main/java/com/codepath/oauth/OAuthTokenClient.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,20 @@ public OAuthTokenClient(BaseApi apiInstance, String consumerKey, String consumer
3434
this.apiInstance = apiInstance;
3535
this.handler = handler;
3636
if (callbackUrl == null) { callbackUrl = OAuthConstants.OUT_OF_BAND; };
37-
this.service = new ServiceBuilder()
37+
if(scope == null) {
38+
this.service = new ServiceBuilder()
39+
.apiKey(consumerKey)
40+
.apiSecret(consumerSecret).callback(callbackUrl)
41+
.httpClientConfig(OkHttpHttpClientConfig.defaultConfig())
42+
.build(apiInstance);
43+
} else {
44+
this.service = new ServiceBuilder()
3845
.apiKey(consumerKey)
3946
.apiSecret(consumerSecret).callback(callbackUrl)
4047
.httpClientConfig(OkHttpHttpClientConfig.defaultConfig())
4148
.scope(scope) // OAuth2 requires scope
4249
.build(apiInstance);
50+
}
4351
}
4452

4553
// Get a request token and the authorization url

0 commit comments

Comments
 (0)