Skip to content

Commit

Permalink
linkedin module
Browse files Browse the repository at this point in the history
  • Loading branch information
Koushik-inno committed Aug 3, 2019
1 parent 541dd62 commit 0ac04f8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
6 changes: 3 additions & 3 deletions linkedinLogin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
}

group='com.github.koushikcse'
version = '1.1'
version = '1.2'

android {
compileSdkVersion 28
Expand All @@ -22,8 +22,8 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
versionCode 2
versionName "1.1"
versionCode 3
versionName "1.2"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class LinkedinSignInActivity : Activity() {
private var redirectUri: String? = null
private var state: String? = null
private var scopes: List<String>? = null
private var isLogedIn = true

@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
override fun onCreate(savedInstanceState: Bundle?) {
Expand Down Expand Up @@ -182,21 +183,25 @@ class LinkedinSignInActivity : Activity() {
conn.disconnect()
if (response.has("access_token")) {
finish()
runOnUiThread {
val restService = Linkedin.linkedinLoginListener?.let {
ProfileRestService(
LinkedinToken(response.getString("access_token"), response.getLong("expires_in")),
it
)
if (isLogedIn) {
runOnUiThread {
val restService = Linkedin.linkedinLoginListener?.let {
ProfileRestService(
LinkedinToken(response.getString("access_token"), response.getLong("expires_in")),
it
)
}
restService?.getLinkedInProfile()
}
restService?.getLinkedInProfile()
}
} else {
finish()
runOnUiThread {
Linkedin.linkedinLoginListener?.failedLinkedinLogin(response.getString("error_description"))
isLogedIn = false
}
}
// else {
// finish()
// runOnUiThread {
// Linkedin.linkedinLoginListener?.failedLinkedinLogin(response.getString("error_description"))
// }
// }
} catch (e: Exception) {
e.printStackTrace()
}
Expand Down

0 comments on commit 0ac04f8

Please sign in to comment.