Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

카카오 로그인 및 로그아웃에 관련된 오류를 RN으로 토스하지 않는것 같습니다. #46

Closed
T-PangE opened this issue Apr 18, 2019 · 1 comment

Comments

@T-PangE
Copy link

T-PangE commented Apr 18, 2019

iOS의 경우 NSNull을 그냥 callback에 주고있는것으로 보입니다.

if ([session isOpen]) {
            NSString* token = session.token.accessToken;
            NSString* result = [NSString stringWithFormat:@"{\"token\": \"%@\"}", token];

            callback(@[[NSNull null], result]);
        } else {
            RCTLogInfo(@"Error=%@", error);
            callback(@[@"SignIn failed.\n", [NSNull null]]);
        }

안드로이드는 그나마 ErrorCallback이 있긴하지만.. json에 대한 exception으로만 되어있네요..

 if (loginCallback != null) {
        JSONObject response = new JSONObject();
        String token = Session.getCurrentSession().getAccessToken();
        try {
          response.put("token",token);
          loginCallback.invoke(null,response.toString());
          loginCallback = null;
        } catch (JSONException e) {
          loginCallback.invoke(e.toString(), null);
        }
      }
    }

    @Override
    public void onSessionOpenFailed(KakaoException exception) {
      if(exception != null) {
        if (loginCallback != null) {
          loginCallback.invoke(null, exception.toString());
          loginCallback = null;
        }
        Log.e(TAG, "Logged in!\nSessionOpenFailed");
        Logger.e(exception);
      }
    }

해당 라이브러리를 사용해서 kakao login cancel이나 error들에 대한 처리는 할 수 없나요?

@heyman333
Copy link
Contributor

Closing in favor of #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants