Skip to content

Commit

Permalink
issue #35 other properties can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyxis committed Oct 25, 2018
1 parent 763ee52 commit 98deccf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.github.windsekirun.rxsociallogin.intenal.model.PlatformType
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.rxkotlin.addTo
import kotlinx.android.synthetic.main.activity_main.*
import pyxis.uzuki.live.richutilskt.utils.getKeyHash


class MainActivity : AppCompatActivity() {
Expand All @@ -21,7 +22,7 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

// Log.d(MainActivity::class.java.simpleName, "KeyHash: ${getKeyHash()}")
Log.d(MainActivity::class.java.simpleName, "KeyHash: ${getKeyHash()}")

btnDisqus.setOnClickListener {
RxSocialLogin.login(PlatformType.DISQUS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class MainApplication : Application() {
}

kakao {
requireAgeRange = true
// requireAgeRange = true
requireBirthday = true
requireEmail = true
requireGender = true
// requireEmail = true
// requireGender = true
}

line(getString(R.string.line_api_channel))
Expand All @@ -63,20 +63,20 @@ class MainApplication : Application() {
getString(R.string.naver_api_secret),
getString(R.string.app_name))

twitch(getString(R.string.twitch_api_key),
getString(R.string.twitch_api_secret),
getString(R.string.twitch_redirect_uri)) {
requireEmail = true
activityTitle = "Login to Twitch"
}
// twitch(getString(R.string.twitch_api_key),
// getString(R.string.twitch_api_secret),
// getString(R.string.twitch_redirect_uri)) {
// requireEmail = true
// activityTitle = "Login to Twitch"
// }

twitter(getString(R.string.twitter_api_id), getString(R.string.twitter_api_secret))

vk {
requireEmail = true
}
// vk {
// requireEmail = true
// }

windows(getString(R.string.windows_api_key))
// windows(getString(R.string.windows_api_key))

wordpress(getString(R.string.wordpress_api_key),
getString(R.string.wordpress_api_secret),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,20 @@ class KakaoLogin constructor(activity: FragmentActivity) : BaseSocialLogin(activ
val userAccount = result.kakaoAccount

if (userAccount != null && userAccount.hasEmail() == OptionalBoolean.TRUE) {
email = userAccount.email
isEmailVerified = userAccount.isEmailVerified == OptionalBoolean.TRUE
email = userAccount.email ?: ""
isEmailVerified = userAccount.isEmailVerified ?: OptionalBoolean.FALSE == OptionalBoolean.TRUE
}

if (userAccount != null && userAccount.hasAgeRange() == OptionalBoolean.TRUE) {
ageRange = userAccount.ageRange!!.value
ageRange = userAccount.ageRange?.value ?: ""
}

if (userAccount != null && userAccount.hasGender() == OptionalBoolean.TRUE) {
gender = userAccount.gender!!.value
gender = userAccount.gender?.value ?: ""
}

if (userAccount != null && userAccount.hasBirthday() == OptionalBoolean.TRUE) {
birthday = userAccount.birthday
birthday = userAccount.birthday ?: ""
}

val item = LoginResultItem().apply {
Expand Down

0 comments on commit 98deccf

Please sign in to comment.