Skip to content

Commit 4c5e70c

Browse files
authored
2.0.3-release
1 parent 17113b8 commit 4c5e70c

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ repositories {
5555
5. Add the following implementation statement to the `dependencies{}` section:
5656
```gradle
5757
dependencies {
58-
implementation 'com.tiktok.open.sdk:tiktok-open-sdk-core:2.0.2'
59-
implementation 'com.tiktok.open.sdk:tiktok-open-sdk-auth:2.0.2' // to use authorization api
60-
implementation 'com.tiktok.open.sdk:tiktok-open-sdk-share:2.0.2' // to use share api
58+
implementation 'com.tiktok.open.sdk:tiktok-open-sdk-core:2.0.3'
59+
implementation 'com.tiktok.open.sdk:tiktok-open-sdk-auth:2.0.3' // to use authorization api
60+
implementation 'com.tiktok.open.sdk:tiktok-open-sdk-share:2.0.3' // to use share api
6161
}
6262
```
6363

tiktok-open-sdk-auth/src/main/java/com/tiktok/open/sdk/auth/AuthApi.kt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,9 @@ class AuthApi(private val activity: Activity) {
9191
}
9292
val data = intent.data
9393
val bundle = intent.extras
94-
if (data != null &&
95-
redirectUrl == "${data.scheme}://${data.host}"
96-
) {
97-
if (bundle != null &&
98-
bundle.getInt(Keys.Base.TYPE) == com.tiktok.open.sdk.auth.constants.Constants.AUTH_RESPONSE
99-
) {
100-
return bundle.toAuthResponse()
101-
} else {
102-
return WebAuthHelper.parseRedirectUriToAuthResponse(data)
103-
}
104-
} else if (bundle != null) {
94+
if (data?.toString()?.startsWith(redirectUrl) == true) {
95+
return WebAuthHelper.parseRedirectUriToAuthResponse(data)
96+
} else if (bundle?.getInt(Keys.Base.TYPE) == com.tiktok.open.sdk.auth.constants.Constants.AUTH_RESPONSE) {
10597
return bundle.toAuthResponse()
10698
}
10799
return null

tiktok-open-sdk-auth/src/main/java/com/tiktok/open/sdk/auth/AuthRequest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ data class AuthRequest(
3838
@IgnoredOnParcel
3939
override val type: Int = Constants.AUTH_REQUEST
4040

41-
override fun validate(): Boolean = scope.isNotEmpty()
41+
override fun validate(): Boolean = scope.isNotEmpty() && clientKey.isNotEmpty() && redirectUri.isNotEmpty() && codeVerifier.isNotEmpty()
4242

4343
override fun toBundle(): Bundle {
4444
return super.toBundle(BuildConfig.AUTH_SDK_NAME, BuildConfig.AUTH_SDK_VERSION).apply {

tiktok-open-sdk-share/src/main/java/com/tiktok/open/sdk/share/ShareApi.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ class ShareApi(private val activity: Activity) {
7171
return null
7272
}
7373
val bundle = intent.extras
74-
if (bundle != null &&
75-
bundle.getInt(Keys.Share.TYPE) == Constants.SHARE_RESPONSE
76-
) {
74+
if (bundle?.getInt(Keys.Share.TYPE) == Constants.SHARE_RESPONSE) {
7775
return bundle.toShareResponse()
7876
}
7977
return null

0 commit comments

Comments
 (0)