메서드
Last updated
Was this helpful?
Was this helpful?
wepinPin.generateRegistrationPINBlock().whenComplete((res, err) -> {
if (err == null) {
RegistrationPinBlock registerPin = new RegistrationPinBlock(res.getUvd(), res.getHint());
// You need to make a Wepin RESTful API request using the received data.
} else {
System.out.println(err);
}
});
wepinPin.generateRegistrationPINBlock().whenComplete { res, err ->
if (err == null) {
registerPin = RegistrationPinBlock(uvd = res!!.uvd, hint = res!!.hint)
// You need to make a Wepin RESTful API request using the received data.
} else {
println(err)
}
}wepinPin.generateAuthPINBlock(3)wepinPin.generateAuthPINBlock(3).whenComplete((res, err) -> {
if (err == null) {
AuthPinBlock authPin = new AuthPinBlock(res.getUvdList(), res.getOtp());
// You need to make a Wepin RESTful API request using the received data.
} else {
System.out.println(err);
}
});
wepinPin.generateAuthPINBlock(3).whenComplete { res, err ->
if (err == null) {
authPin = AuthPinBlock(uvdList = res!!.uvdList, otp = res!!.otp)
// You need to make a Wepin RESTful API request using the received data.
} else {
println(err)
}
}wepinPin.generateChangePINBlock()wepinPin.generateChangePINBlock().whenComplete((res, err) -> {
if (err == null) {
ChangePinBlock changePin = new ChangePinBlock(res.getUvd(), res.getNewUVD(), res.getHint(), res.getOtp());
// You need to make a Wepin RESTful API request using the received data.
} else {
System.out.println(err);
}
});wepinPin.generateChangePINBlock().whenComplete { res, err ->
if (err == null) {
changePin = ChangePinBlock(uvd = res!!.uvd, newUVD = res.newUVD, hint = res.hint, otp = res.otp)
// You need to make a Wepin RESTful API request using the received data.
} else {
println(err)
}
}wepinPin.generateAuthOTPCode()wepinPin.generateAuthOTPCode().whenComplete((res, err) -> {
if (err == null) {
AuthOTP authOTPCode = new AuthOTP(res.getCode());
// You need to make a Wepin RESTful API request using the received data.
} else {
System.out.println(err);
}
});wepinPin.generateAuthOTPCode().whenComplete { res, err ->
if (err == null) {
authOTPCode = AuthOTP(res!!.code)
// You need to make a Wepin RESTful API request using the received data.
} else {
println(err)
}
}wepinPin.finalize()wepinPin.finalize();wepinPin.finalize()// OAuth Provider를 사용한 로그인
wepinSDK.login.loginWithOauthProvider("google", "your-client-id")
.thenCompose { authResult ->
// ID Token을 사용한 로그인
wepinSDK.login.loginWithIdToken(authResult.idToken)
}.thenCompose { idTokenResult ->
// 위핀에 로그인
wepinSDK.login.loginWepin(idTokenResult)
}.thenAccept { user ->
Log.d("WepinSDK", "로그인 성공! 사용자 정보: $user")
}.exceptionally { e ->
Log.e("WepinSDK", "로그인 실패: ${e.message}", e)
null
}
// 이메일 및 비밀번호로 회원가입 및 로그인
wepinSDK.login.signUpWithEmailAndPassword(
email = 'example@example.com',
password = 'password123'
).thenAccept { signUpResult ->
Log.d("WepinSDK", "로그인 성공! 사용자 정보: $user")
}.exceptionally { error ->
if (error is WepinError) {
}
}
// 현재 로그인된 사용자 가져오기
var currentUser = wepinSDK.login.getCurrentWepinUser()
.thenAccept { user ->
Log.d("WepinSDK", "현재 사용자: $user")
}.exceptionally { e ->
Log.e("WepinSDK", "사용자 가져오기 실패", e)
null
}
// 로그아웃
wepinSDK.login.logout()
.thenAccept { result ->
Log.d("WepinSDK", "로그아웃 결과: $result")
}.exceptionally { e ->
Log.e("WepinSDK", "로그아웃 실패", e)
null
}