0
votes

I have a project on Unity 4.6 where I need to integrate sharing and leader-boards. I successfully added this functionality and in the Unity editor it works fine; I can share the results on my wall in Facebook.

However, when I try to do this on my iPad, Safari shows a message that I already have been authorized for this application, with 2 buttons - "Cancel" and "OK".

When I press the "OK" button, it then displays "Open this page in 'App name'" which puzzles me. Pressing "OK" again returns me back to the application and nothing happens.

I attached my logs (from Xcode) when pressing my "Share" or "Leaderboards" buttons.

2015-11-05 12:28:36.123 hrunn3r[509:121343] -canOpenURL: failed for URL: "fbauth://authorize?auth_type=rerequest&response_type=token%2Csigned_request&e2e=%7B%22init%22%3A1446715716118%7D&redirect_uri=fbconnect%3A%2F%2Fsuccess&sdk_version=3.20.0%2FUnity.6.2.2&return_scopes=true&client_id=1613734922227585&legacy_override=v2.2&state=%7B%22is_open_session%22%3Atrue%2C%22is_active_session%22%3Atrue%2C%22com.facebook.sdk_client_state%22%3Atrue%2C%223_method%22%3A%22fb_application_web_auth%22%2C%220_auth_logger_id%22%3A%227763118C-A619-4EF1-AD09-D05788AF9B6E%22%7D&sdk=ios&display=touch&scope=email%2Cpublish_actions" - error: "This app is not allowed to query for scheme fbauth" -> applicationWillResignActive() 2015-11-05 12:28:36.753 hrunn3r[509:121343] Uncaught exception: com.facebook.sdk:InvalidOperationException: FBSession: It is not valid to reauthorize while a previous reauthorize call has not yet completed. 2015-11-05 12:28:36.764 hrunn3r[509:121343] *** Terminating app due to uncaught exception 'com.facebook.sdk:InvalidOperationException', reason: 'FBSession: It is not valid to reauthorize while a previous reauthorize call has not yet completed.

1
What version of the Facebook Unity SDK are you using? This may be resolved in the latest release: 7.2.2zzzzzz

1 Answers

0
votes

Seems like i made wrong my social scripts. I tried to make this with my template classes and this problem disappeared

    private void OnFbLogin()
{
    FB.Init(OnInitComplete, OnHideUnity);
}

private void OnInitComplete()
{
    if (FB.IsLoggedIn == false)
    {
        FB.Login();
    }

}

private void OnHideUnity(bool isGameShown)
{
    Debug.Log("Is game showing? " + isGameShown);
}

private void OnPost()
{
    Debug.Log("start posting");
    FB.Feed(
           linkCaption: "Test",
           linkName: "LinkName",
           linkDescription: "LinkDescription",
           picture: "",
           link: ""
           );
}

After this in xCode i got a new problem:

NSURLSession/NSURLConnection HTTP load failed

And i found the solution in this topic:

NSURLSession/NSURLConnection HTTP load failed on iOS 9

After that it worked