Google Play Games Services docs에 이미 지정된 단계를 따르십시오. 2. Google에 게임을 추가 Google에
1 단계 로그인 Play 개발자 콘솔
단계 Play 개발자 콘솔
3 단계 생성의 OAuth 2.0 클라이언트 ID
확인 GPGS Android Samples in Github도 마찬가지입니다.
로그인 기능을 위해 작성해야하는 실제 코드는 무엇입니까?
private static int RC_SIGN_IN = 9001;
private boolean mResolvingConnectionFailure = false;
private boolean mAutoStartSignInflow = true;
private boolean mSignInClicked = false;
// ...
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
if (mResolvingConnectionFailure) {
// Already resolving
return;
}
// If the sign in button was clicked or if auto sign-in is enabled,
// launch the sign-in flow
if (mSignInClicked || mAutoStartSignInFlow) {
mAutoStartSignInFlow = false;
mSignInClicked = false;
mResolvingConnectionFailure = true;
// Attempt to resolve the connection failure using BaseGameUtils.
// The R.string.signin_other_error value should reference a generic
// error string in your strings.xml file, such as "There was
// an issue with sign in, please try again later."
if (!BaseGameUtils.resolveConnectionFailure(this,
mGoogleApiClient, connectionResult,
RC_SIGN_IN, R.string.signin_other_error)) {
mResolvingConnectionFailure = false;
}
}
// Put code here to display the sign-in button
}
내가이 오류 받고 있어요 방법 Implement Sign-in 귀하의 안드로이드 게임에서
: –
java.lang.NoSuchMethodError : 없음 직접적인 방법을. 메인 클래스를 가리키며, mGoogleApiClient.connect(); ~이다. –