KatanaProxyAuthHandler error, proxied app not found
Hello, I noticed on some devices the facebook login failed. After some digging, I found it was when the authentication was processed using the KatanaProxyAuthHandler, and the exception was "The proxied app is not already installed.". Moreover, it was not switching to the web authentication as fallback.
The only workaround I found was to remove the Katana handler from handlers' list. It opens now the web authentication dialog directly.
PS: The Facebook app installed on the device is working fine and is up to date.
I have a similar problem! It's really strange!
The authentication works fine with the FacebookLoginButton for me (facebook developer) and for others people. When I try to request publish permissions, it works fine for me, but for other people (different facebook user) the app try to show a page but it fails. The debug error is: "The proxied app is not already installed."
Of course the smartphones have the facebook app and I made the app public clicking YES in the settings.
I don't know what is the KatanaProxyAuthHandler, I don't use this class, but maybe I use it indirectly.
Thanks for the report. I'll dig into this. It turns out it is not an SDK problem, but a server issue with our transition to v2.0 APIs.
KatanaProxyAuthHandler is the code which does the switch to the FB app for login. If you remove it, you will end up falling back to a web dialog for login. You don't want to remove it, it makes for a better smoother experience for people. That said, if you are running into issues and are happy with the web dialog and need to ship today, by all means do what you need to do :)
@dmmiller , for your information:
I tried the @lukaspili 's workaround. I commented this line in AuthorizationClient: handlers.add(new KatanaProxyAuthHandler());
Now, when I try to login and request publish permission the web dialog shows up, but the problem persists. I (facebook user developer) can login and get publish permission, but other people can only login while the publish permission is not granted.
Please, let me know when and if the server issue will be resolved.
Actually I still the issue, same as @tufanomichele said above. So the workaround does not work.
Can one of you be more specific (code sample) with what you are trying to do when you see this? I am trying to repro this and see what the issue is. I know of one issue where we would return that error, but I'm not convinced that that covers your case.
This is all my ScoreboardActivity, where the app shows the friends' scores. In onCreate, if the user haven't obtained yet the publish permission, the activity shows a "Save Score" button. When the user click on the button, the app shows an alert and then, if the user click yes, the app starts to request the publish permission.
Let me know if you need other details.
public class ScoreboardActivity extends Activity{
private SnakeApplication application;
private Handler uiHandler;
private ListView scoresList;
private ArrayList<ScoreboardEntry> scoreboardEntriesList;
private ScoreboardAdapter adapter;
private static final List<String> PERMISSIONS = Arrays.asList("publish_actions");
private static final int AUTH_PUBLISH_ACTIONS_SCORES_ACTIVITY_CODE = 103;
private UiLifecycleHelper uiHelper;
private Session.StatusCallback callback =
new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
//Nothing
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scoreboard);
uiHelper = new UiLifecycleHelper(this, callback);
uiHelper.onCreate(savedInstanceState);
//Save Score Management
Button saveScoreButton = (Button) findViewById(R.id.save_score_button);
Session session = Session.getActiveSession();
if (session == null || !session.isOpened()) {
return;
}
List<String> permissions = session.getPermissions();
if (permissions.contains("publish_actions")) {
saveScoreButton.setVisibility(View.GONE);
}
saveScoreButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
askForPublishActionsForScores();
}
});
scoresList =(ListView) findViewById(R.id.scores_list);
application = (SnakeApplication) getApplication();
uiHandler = new Handler();
if (application.getScoreboardEntriesList() == null) {
requestScores();
} else{
populateScoreboard();
}
}
private void requestScores(){
String fbAppID = application.getFbAppID();
final Session session = Session.getActiveSession();
Request scoresGraphPathRequest = Request.newGraphPathRequest(session,
fbAppID + "/scores" ,
new Request.Callback() {
@Override
public void onCompleted(Response response) {
FacebookRequestError error = response.getError();
if (error != null) {
Log.e(application.TAG, error.toString());
} else if (session == Session.getActiveSession()) {
if (response != null) {
GraphObject graphObject = response.getGraphObject();
JSONArray dataArray = (JSONArray)graphObject.getProperty("data");
scoreboardEntriesList = new ArrayList<ScoreboardEntry>();
for (int i=0; i< dataArray.length(); i++) {
JSONObject oneData = dataArray.optJSONObject(i);
int score = oneData.optInt("score");
JSONObject userObj = oneData.optJSONObject("user");
String userID = userObj.optString("id");
String userName = userObj.optString("name");
scoreboardEntriesList.add(new ScoreboardEntry(userID, userName, score));
}
Comparator<ScoreboardEntry> comparator = Collections.reverseOrder();
Collections.sort(scoreboardEntriesList, comparator);
application.setScoreboardEntriesList(scoreboardEntriesList);
// Populate the scoreboard on the UI thread
uiHandler.post(new Runnable() {
@Override
public void run() {
populateScoreboard();
}
});
}
}
}
});
Request.executeBatchAsync(scoresGraphPathRequest);
}
private void populateScoreboard(){
adapter=new ScoreboardAdapter(this, application.getScoreboardEntriesList());
scoresList.setAdapter(adapter);
}
private void askForPublishActionsForScores() {
new AlertDialog.Builder(this)
.setPositiveButton("yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
// User hit OK. Request Facebook friends permission.
requestPublishPermissions();
}
})
.setNegativeButton("no", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// User hit cancel.
// Hide the gameOverContainer
//gameOverContainer.setVisibility(View.INVISIBLE);
}
})
.setTitle("title")
.setMessage("dialog_message")
.show();
}
void requestPublishPermissions() {
Log.d("main", "Requesting publish permissions.");
final Session session = Session.getActiveSession();
if (session != null) {
Session.NewPermissionsRequest newPermissionsRequest = new Session.NewPermissionsRequest(this, PERMISSIONS)
// demonstrate how to set an audience for the publish permissions,
// if none are set, this defaults to FRIENDS
.setDefaultAudience(SessionDefaultAudience.FRIENDS)
.setRequestCode(AUTH_PUBLISH_ACTIONS_SCORES_ACTIVITY_CODE);
session.requestNewPublishPermissions(newPermissionsRequest);
}
}
@Override
public void onResume() {
super.onResume();
uiHelper.onResume();
}
@Override
public void onPause() {
super.onPause();
uiHelper.onPause();
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
uiHelper.onActivityResult(requestCode, resultCode, data);
}
@Override
public void onDestroy() {
super.onDestroy();
uiHelper.onDestroy();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
uiHelper.onSaveInstanceState(outState);
}
}
I believe this to actually be a server issue and am working on a fix.
Any news?
Same, any ETA on a fix ? Thanks
Just had this same problem too. Seems random though.
Whats the solution?
It's a blocking issue for using Facebook SDK right now.
@dmmiller do you have any good news about this issue? Or a workaround that can be used in the meantime ? This is blocking any new development.
Hey guys - seeing this issue in Production apps for some users, any idea on how to fix?
FYI - I was able to solve this by removing the publish_stream permission, and requesting both write and read separately.
Ah, yes. Sorry I missed that. Read and write permissions are two different requests. They can't be asked for at the same time.
Is this new? Was working fine for me for a while.
What's the deal here, this is not an SDK issue, I'm running identical code , one app was created years ago the other is recent, the recent app fails with this error every time. Perhaps you should allow targeting the v1.0 api if you can't figure out a fix.
This was hard to troubleshot because used that already authed your app before - had no issues - only new ones. You don't have to do this with web auth or iOS SDK, just Android SDK. Very strange!
Hi all -- We have identified and fixed a server-side issue that we believe was the root cause of this problem. The fix will go live tomorrow afternoon. Please keep an eye out for this issue and let us know if you continue to experience issues after tomorrow. Sorry for the annoyance this has caused and thank you all for reporting the issue and providing further information about it.