File tree Expand file tree Collapse file tree 4 files changed +8
-18
lines changed
tiktok-open-sdk-auth/src/main/java/com/tiktok/open/sdk/auth
tiktok-open-sdk-share/src/main/java/com/tiktok/open/sdk/share Expand file tree Collapse file tree 4 files changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -55,9 +55,9 @@ repositories {
55555 . Add the following implementation statement to the ` dependencies{} ` section:
5656``` gradle
5757dependencies {
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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments