Skip to content

Commit

Permalink
2.2.0-release (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
youngKimTikTok authored Oct 26, 2023
1 parent aca04ba commit d5197df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import android.app.Activity
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.provider.MediaStore
import android.widget.Button
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
Expand Down Expand Up @@ -92,10 +93,13 @@ class SelectMediaActivity : AppCompatActivity() {
}

private fun openSystemGallery() {
val intent = Intent(Intent.ACTION_GET_CONTENT)
val intent = if (isSharingImage) {
Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
} else {
Intent(Intent.ACTION_PICK, MediaStore.Video.Media.EXTERNAL_CONTENT_URI)
}
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true)
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
intent.type = if (isSharingImage) "image/*" else "video/*"
startActivityForResult(intent, OPEN_GALLERY_REQUEST_CODE)
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android.useAndroidX=true
android.enableJetifier=true

ARTIFACT_GROUP = com.tiktok.open.sdk
ARTIFACT_VERSION = 2.0.3
ARTIFACT_VERSION = 2.2.0

# core module
CORE_ARTIFACT_ID = tiktok-open-sdk-core
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ class AuthApi(private val activity: Activity) {
}
val data = intent.data
val bundle = intent.extras
if (data?.toString()?.startsWith(redirectUrl) == true) {
return WebAuthHelper.parseRedirectUriToAuthResponse(data)
} else if (bundle?.getInt(Keys.Base.TYPE) == com.tiktok.open.sdk.auth.constants.Constants.AUTH_RESPONSE) {
if (bundle?.getInt(Keys.Base.TYPE) == com.tiktok.open.sdk.auth.constants.Constants.AUTH_RESPONSE) {
return bundle.toAuthResponse()
} else if (data?.toString()?.startsWith(redirectUrl) == true) {
return WebAuthHelper.parseRedirectUriToAuthResponse(data)
}
return null
}
Expand Down

0 comments on commit d5197df

Please sign in to comment.