Modifier and Type | Method and Description |
---|---|
void |
addCallback(ISessionCallback callback)
세션 상태 변화 콜백을 받고자 할때 콜백을 등록한다.
|
boolean |
checkAndImplicitOpen()
Session 의 상태를 체크후
isOpenable() 상태일 때 Login을 시도한다. |
void |
clearCallbacks()
Remove all session callbacks.
|
void |
close()
명시적 강제 close(로그아웃/탈퇴).
|
AccessTokenCallback |
getAccessTokenCallback() |
AccessTokenManager |
getAccessTokenManager()
Returns an AccessTokenManager instance owned by this Session
|
com.kakao.util.helper.SharedPreferencesCache |
getAppCache()
앱 캐시를 반환한다.
|
AuthCodeCallback |
getAuthCodeCallback() |
AuthCodeManager |
getAuthCodeManager()
Returns an AuthCodeManager instance owned by this Session
|
static Session |
getCurrentSession()
Returns current Session instance.
|
com.kakao.auth.Session.RequestType |
getRequestType()
현재 진행 중인 요청 타입
|
AccessToken |
getTokenInfo()
Returns currently manage
AccessToken instance containing access token and refresh
token information. |
boolean |
handleActivityResult(int requestCode,
int resultCode,
android.content.Intent data)
로그인 activity를 이용하여 sdk에서 필요로 하는 activity를 띄운다.
|
boolean |
isClosed()
현재 세션이 닫힌 상태인지 여부를 반환한다.
|
boolean |
isOpenable()
현재 세션이 오픈중(갱신 포함) 상태인지 여부를 반환한다.
|
boolean |
isOpened()
현재 세션이 열린 상태인지 여부를 반환한다.
|
void |
open(AuthType authType,
android.app.Activity callerActivity)
세션 오픈을 진행한다.
|
void |
open(AuthType authType,
android.app.Activity callerActivity,
Map<String,String> extraParams) |
void |
open(AuthType authType,
Fragment fragment)
세션 오픈을 진행한다.
|
void |
open(AuthType authType,
Fragment callerFragment,
Map<String,String> extraParams) |
void |
openWithAuthCode(String authCode)
Try login (open session) with authorization code.
|
void |
openWithCustomAccountsUrl(android.app.Activity activity,
Map<String,String> extraParams,
String path,
Map<String,String> accountParams)
카카오계정의 특정 페이지를 활용하여 인증처리 후 로그인을 수행합니다.
|
Future<AccessToken> |
refreshAccessToken(AccessTokenCallback callback)
Refresh access token with refresh token, even if access token hasn't expired.
|
void |
removeCallback(ISessionCallback callback)
더이상 세션 상태 변화 콜백을 받고 싶지 않을 때 삭제한다.
|
void |
updateScopes(android.app.Activity activity,
List<String> scopes,
AccessTokenCallback callback)
Update user's scopes (user's agreement to provide specific data to this application) manually.
|
void |
updateScopes(Fragment fragment,
List<String> scopes,
AccessTokenCallback callback) |
public void addCallback(ISessionCallback callback)
addCallback
in interface ISession
callback
- 추가할 세션 콜백public boolean checkAndImplicitOpen()
isOpenable()
상태일 때 Login을 시도한다.
요청에 대한 결과는 KakaoAdapter
의 ISessionCallback
으로 전달이 된다.
public void clearCallbacks()
clearCallbacks
in interface ISession
public void close()
Session callbacks are not invoked, if there are any.
public AccessTokenCallback getAccessTokenCallback()
getAccessTokenCallback
in interface ISession
public AccessTokenManager getAccessTokenManager()
getAccessTokenManager
in interface ISession
public com.kakao.util.helper.SharedPreferencesCache getAppCache()
public AuthCodeCallback getAuthCodeCallback()
public AuthCodeManager getAuthCodeManager()
getAuthCodeManager
in interface ISession
public static Session getCurrentSession()
public com.kakao.auth.Session.RequestType getRequestType()
public final AccessToken getTokenInfo()
AccessToken
instance containing access token and refresh
token information.getTokenInfo
in interface ISession
AccessToken
instancepublic boolean handleActivityResult(int requestCode, int resultCode, android.content.Intent data)
requestCode
- requestCode of onActivityResult callbackresultCode
- resultCode of onActivityResult callbackdata
- intent data of onActivityResult callbackpublic final boolean isClosed()
public boolean isOpenable()
1. Access token이 없거나 만료되었고, auth code가 발급되어 있는 상태. 2. Access token이 없거나 만료되었고, refresh token이 있는 상태.
isOpenable
in interface ISession
public final boolean isOpened()
public void open(AuthType authType, android.app.Activity callerActivity)
public void open(AuthType authType, android.app.Activity callerActivity, Map<String,String> extraParams)
public void open(AuthType authType, Fragment fragment)
public void openWithAuthCode(String authCode)
openWithAuthCode
in interface ISession
authCode
- Authorization code acquired by Kakao account authentication/authorizationpublic void openWithCustomAccountsUrl(android.app.Activity activity, Map<String,String> extraParams, String path, Map<String,String> accountParams)
activity
- activityextraParams
- 동의창에 전달할 추가 파라미터path
- 카카오 계정 사이트 내 요청할 pathaccountParams
- 계정 페이지에 전달할 파라미터public Future<AccessToken> refreshAccessToken(AccessTokenCallback callback)
This method closes session if refreshing fails with http status 400 or 401. This usually happens under the following cases: - when refresh token hash expired - when user has changed his or her Kakao account password
Developers should check if session is closed in failure callback and deal with it.
refreshAccessToken
in interface ISession
callback
- Success/failure callback for access tokenpublic void removeCallback(ISessionCallback callback)
removeCallback
in interface ISession
callback
- 삭제할 콜백public void updateScopes(android.app.Activity activity, List<String> scopes, AccessTokenCallback callback)
InsufficientScopeException
. From 1.11.0, Applications
can manually request updating user scopes with this method.
Example scopes are: - account_email - phone_number
activity
- activityscopes
- List of scopes to be requested explicitlycallback
- access token callbackpublic void updateScopes(Fragment fragment, List<String> scopes, AccessTokenCallback callback)
fragment
- fragmentscopes
- List of scopes to be requested explicitlycallback
- access token callbackupdateScopes(Activity, List, AccessTokenCallback)