'Facebook app working only for administrator. Why?

I have created a facebook app. From my website the users can log in using their facebook account. Once they log in successfully the facebook javascript API which i use will post the URL to the user's newfeed with their permission.

The problem is, this is working perfectly when i use my account to login from the website and I could see the post in my newsfeed.

When logging in with someone else account the post is not seen in their newsfeed.

Note : I am the only administrator of facebook app and Sandbox mode is disabled.

Is there any settings i need to make such that this functionality works for all the users ?

Code Used :

//Get values from hidden field
var appid = document.getElementById("appid").value;
var message = document.getElementById("message").value;
var link = document.getElementById("link").value;
var name = document.getElementById("name").value;
var picture = document.getElementById("picture").value;
var description = document.getElementById("description").value;
var Post_to_fb = document.getElementById("Post_to_fb").value;


var Authenticated = "";
// Load the SDK Asynchronously
(function (d) {
    var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
    if (d.getElementById(id)) { return; }
    js = d.createElement('script'); js.id = id; js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    ref.parentNode.insertBefore(js, ref);
} (document));

//Init the SDK upon load
window.fbAsyncInit = function () {
    FB.init({
        appId: appid, // App ID
        channelUrl: '//' + window.location.hostname + '/channel', // Path to your Channel File
        status: true, // check login status
        cookie: true, // enable cookies to allow the server to access the session
        xfbml: true  // parse XFBML 
    });



    // listen for and handle auth.statusChange events
    FB.Event.subscribe('auth.statusChange', function (response) {
        if (response.authResponse) {
            // user has auth'd your app and is logged into Facebook
            var uid = "http://graph.facebook.com/" + response.authResponse.userID + "/picture";
            FB.api('/me', function (me) {
                document.getElementById('auth-displayname').innerHTML = me.name;
                document.getElementById('profileImg').src = uid;
            })
            document.getElementById('auth-loggedout').style.display = 'none';
            document.getElementById('auth-loggedin').style.display = 'block';

            var e = document.getElementById("ctl00_cphRightControls_FaceBookPlugin_ddlSocialSwitch");
            var Social_switch = e.options[e.selectedIndex].text;

            //Post to FB only if Social switch is ON
            if (Social_switch == "on") {
                //Post to FB only for Main URL and not when clicking the internal links
                if (Post_to_fb == "True") {

                var opts = {
                    message: message,
                    link: link,
                    name: name,
                    picture: picture,
                    description: description 
                };

                FB.api('/me/feed', 'post', opts, function (response) {
                    if (!response || response.error) {
//                        alert('Posting error occured');
                    }
                    else {
//                        alert('Success - Post ID: ' + response.id);
                    }
                }); 
               } 
           } 

        } else {
            // user has not auth'd your app, or is not logged into Facebook
            document.getElementById('auth-loggedout').style.display = 'block';
            document.getElementById('auth-loggedin').style.display = 'none';
        }

    });
    $("#auth-logoutlink").click(function () {
        FB.logout(function () {
            window.location.reload();
        });
    });
} 


Solution 1:[1]

Try clearing your cookies between logging out of your administrator account and into your dev account, or even better just test using different browsers (chrome profiles are great for this)

The cookie that the facebook js sdk creates for a user (fbsr_{APP_ID}) sticks around for the first load of the next user login and screws things up a bit for that first page load when using it off-canvas (on a website like you mentioned). Facebook isn't completely streamlined for using multiple accounts in one browser how developers often use them. It's very possible that because of this it's trying to post as the wrong user and causing the error. That's my best guess without having more info.

Solution 2:[2]

In my case, the "Country restricted" to United Kingdom was the problem. Upon switching it off, to allow all countries, it worked with other accounts. Secondly, the app must be in Live mode to allow public access. In Dev mode, only Admininstrator and Test users can access.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andy Blackwell
Solution 2 DevGuru