I implement the google play game services on my game. I can connect on it but when I come back to my game, I can't show the welcome POPUP ... How can I show it ?
I tried the setViewForPopups and setGravityForPopups like they said on the documentation...
private void startSignInIntent() {
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN)
.requestEmail()
.build();
GoogleSignInClient signInClient = GoogleSignIn.getClient(getActivity(),
gso);
Intent intent = signInClient.getSignInIntent();
startActivityForResult(intent, RC_SIGN_IN);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
if (result.isSuccess()) {
// The signed in account is stored in the result.
GoogleSignInAccount signedInAccount = result.getSignInAccount();
Games.getGamesClient(getContext(), signedInAccount).setViewForPopups(getView());
} else {
String message = result.getStatus().getStatusMessage();
if (message == null || message.isEmpty()) {
message = getString(R.string.signin_other_error);
}
new AlertDialog.Builder(getActivity()).setMessage(message)
.setNeutralButton(android.R.string.ok, null).show();
}
}
}