Reputation: 728
I am using facebook account kit for verification of the mobile number. Some how I in few cases I am getting System Issue occurred. Please try again later.
Even I am not getting anything onActivityResult as pressing back again putting me to enter mobile number screen that is from SDK itself.
Below is the code of ActivityResult
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 99) { // confirm that this response matches your request
AccountKitLoginResult loginResult = data.getParcelableExtra(AccountKitLoginResult.RESULT_KEY);
String toastMessage;
if (loginResult.getError() != null) {
AccountKitError error = loginResult.getError();
try{
int code = error.getDetailErrorCode();
String message = error.getUserFacingMessage();
AccountKitError.Type type = error.getErrorType();
String str_error = "Code : "+code+"\ndescription : "+message+"\ntype : "+type.name()
+"\ntype_message : "+type.getMessage()+"\ntype_code : "+type.getCode();
showAlert(str_error);
}catch (Exception e){
}
Toast.makeText(getApplicationContext(),"Login Error",Toast.LENGTH_SHORT).show();
} else if (loginResult.wasCancelled()) {
Toast.makeText(getApplicationContext(),"Login Canceled",Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(),"Logged IN",Toast.LENGTH_SHORT).show();
}
}
}
But it always go to login canceled. As per below link https://developers.facebook.com/docs/reference/android/4.11/interface/AccountKitLoginResult/ the AccountKitLoginResult is no longer available but still in overview suggesting to use same.
Any one has the same issue?
Upvotes: 1
Views: 1025
Reputation: 408
AccountKitLoginResult is actually available and it's the right way of getting the data. I think you were just looking at the older documentation. Here is the current one: https://developers.facebook.com/docs/reference/androidsdk/current/AccountKit/com/facebook/accountkit/accountkitloginresult.html/
Does your app go directly from entering the phone number screen to error screen without giving you the option to enter your verification key? If so, then the onActivityResult shouldn't get called since there was a system error. Here's a few suggestion for where the error might be coming from:
If you still can't fix it, maybe you could post the part of your AndroidManifest and your onLogin method (where you set up AccountKitConfiguration) to give more context
Upvotes: 1