Question

I have a Facebook App (a game) that is perfectly working if I access the URLs directly (https://apps.facebook.com/[appnamespace]/ or https://mydomain.com/, the last one being the canvas URL). But every time I submit the app for review I get the following feedback: "Please address the following feedback from our review team. Once you have made the changes listed below you may resubmit for review." and "Your app's Canvas page doesn't load".

Problem is I don't really know what to change because for me and for friends with whom I shared the link it's working as expected.

I have only one error in the console in Chrome which is:
"Unsafe JavaScript attempt to access frame with URL https://apps.facebook.com/[appnamespace]/ from frame with URL https://mydomain.com/. The frame being accessed set 'document.domain' to 'facebook.com', but the frame requesting access did not. Both must set 'document.domain' to the same value to allow access.

I don't have document.domain specified in my page though I tried some values before to get rid of this error message without success. And every time I set a value for document.domain I get another error in the console: "Uncaught Error: SecurityError: DOM Exception 18".

I didn't find anything on this that is working.
So any help/hint would be appreciated. I also tried to ask for more detailed feedback in the review description message but I still get the same message with no clue on how to solve the problem.

Thanks.

Was it helpful?

Solution

So I finally solved the issue.
The problem was that I didn't test the app when the user is not connected to Facebook. For me the app was not supposed to be used outside Facebook game center (though it's possible) and Facebook probably test this case during app review. Hence none of the following events gets fired:

  • auth.statusChange
  • auth.authResponseChange
  • auth.login

To tackle this problem I make a call to getLoginStatus, something like this:

FB.getLoginStatus(function (response) {
        console.log('[Facebook] getLoginStatus: ' + response.status);

        if (response.status !== 'connected' &&
            response.status !== 'not_authorized')
        {
            console.log('[Facebook] not connected');
            $('#loginscreen').show();
            $('#btn-fb-login').click(function (event) {
                event.preventDefault();
                FB.login(function (response) {
                    $('#loginscreen').hide();
                    start(response);
                }, { scope: 'email,publish_actions'});
            });
        }
    });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top