me(keys, new MeV2ResponseCallback() 동작을 안해서 deprecated 된 requestMe(new MeResponseCallback() 쓰니까 동작을 하네요. 무슨원인인지 알수 있을까요?
implementation group: ‘com.kakao.sdk’, name: ‘usermgmt’, version: '1.19.0’
카카오 sdk버젼은 위와 같습니다.
private void requestMe() {
DLog.i("requestMe start");
List<String> keys = new ArrayList<>();
keys.add("properties.nickname");
//keys.add("properties.profile_image");
keys.add("kakao_account.email");
UserManagement.getInstance().requestMe(new MeResponseCallback(){
@Override
public void onSessionClosed(ErrorResult errorResult) {
Log.e("SessionCallback :: ", "onSessionClosed : " + errorResult.getErrorMessage());
}
// 회원이 아닌 경우,
@Override
public void onNotSignedUp() {
Log.e("SessionCallback :: ", "onNotSignedUp");
}
// 사용자정보 요청에 성공한 경우,
@Override
public void onSuccess(UserProfile userProfile) {
Log.e("SessionCallback :: ", "onSuccess");
String nickname = userProfile.getNickname();
String email = userProfile.getEmail();
String profileImagePath = userProfile.getProfileImagePath();
String thumnailPath = userProfile.getThumbnailImagePath();
String UUID = userProfile.getUUID();
long id = userProfile.getId();
Log.e("Profile : ", nickname + "");
Log.e("Profile : ", email + "");
Log.e("Profile : ", profileImagePath + "");
Log.e("Profile : ", thumnailPath + "");
Log.e("Profile : ", id + "");
}
});
//
UserManagement.getInstance().me(keys, new MeV2ResponseCallback() {
@Override
public void onDidEnd() {
super.onDidEnd();
Logger.d("onDidEnd");
}
@Override
public void onDidStart() {
super.onDidStart();
Logger.d("onDidStart");
}
@Override
public void onSuccessForUiThread(MeV2Response result) {
super.onSuccessForUiThread(result);
Logger.d("onSuccessForUiThread" + result.toString());
}
@Override
public void onFailure(ErrorResult errorResult) {
String message = "failed to get user info. msg=" + errorResult;
Logger.d(message);
}
@Override
public void onFailureForUiThread(ErrorResult errorResult) {
super.onFailureForUiThread(errorResult);
DLog.e("requestMe onFailureForUiThread message : " + errorResult.getErrorMessage());
}
@Override
public void onSessionClosed(ErrorResult errorResult) {
String message = "onSessionClosed to get user info. msg=" + errorResult;
DLog.e(message);
// redirectLoginActivity();
}
@Override
public void onSuccess(MeV2Response response) {
Logger.d("user id : " + response.getId());
Logger.d("email: " + response.getKakaoAccount().getEmail());
// Logger.d("profile image: " + response.getKakaoAccount()
// .getProfileImagePath());
// redirectMainActivity();
}
});