Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 940399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:57:01+00:00 2026-05-15T21:57:01+00:00

We are facing one problem with facebook. we integrated FB in our web application,

  • 0

We are facing one problem with facebook.
we integrated FB in our web application, when user login through fconnect in our web application then he registered with our system(1st time only) just providing his email id.For normal user few user i/p for registration in our system

Our web-application developed in java [GWT2.0].

Problem is when FACEBOOK or normaluser login through FB in our web-application.( 1 at a time)

when user refreshes page then FB pop window Occues with message

“Debug: Exception while loading FB.apiClient TypeError: $wnd.FB.Facebook is undefined”

or sometimes $wnd.FB.Facebook.apiClient is null occures

we get above error[pop-up] message 3 times.

we used following script in html page
< script type=”text/javascript” language=”javascript”
src=”http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php&#8221;>

In only 1 page of our web-application i.e UserHome page where we display users info .
on that page only above error message occurs

We used following GWT Code [from Gwittit] In controller class[Singleton class ]

/**
* Function get called when all the data on first page get loaded.
*
* */
public void notifyFinishedLoadinPage() {
FacebookConnect.waitUntilStatusReady(new
RenderAppWhenReadyCallback());

}

private MyLoginCallback
loginCallback = new MyLoginCallback();

class MyLoginCallback implements LoginCallback {

    public void onLogin() {
        isFacebookSign = true;
        fbLoggedInUserId = ApiFactory.getInstance().getLoggedInUser();

        for (FacebookObserver Observer : facebookObservers) {
            Observer.notifyFacebookLogin(true);
        }
    }
}

public void publishStream(final FacebookObserver fbObserver) {
    FacebookConnect.init(FacebookConstants.FACEBOOK_API_KEY,

“xd_receiver.htm”, loginCallback);

    FacebookConnect.requireSession(new

AsyncCallback() {

        public void onFailure(Throwable caught) {
            Window.alert("Require session failed: " + caught);
            GWT.log("Require session failed: " + caught, null);
        }

        public void onSuccess(Boolean isLoggedIn) {
            if (isLoggedIn) {
                for (FacebookObserver Observer :

facebookObservers) {
Observer.notifyPublishStream();
}
}
}
});

}

public void facebookConnection() {
    FacebookConnect.init(FacebookConstants.FACEBOOK_API_KEY,

“xd_receiver.htm”, loginCallback);
//SERVER
FacebookConnect.requireSession(new
AsyncCallback() {

        public void onFailure(Throwable caught) {
            GWT.log("Require session failed: " + caught, null);
        }

        public void onSuccess(Boolean isLoggedIn) {
            if (loginCallback != null && isLoggedIn) {
                loginCallback.onLogin();
            } else {
                //User not logged in
            }
        }
    });
}

/**
 * Fired when we know users status
 */
private class RenderAppWhenReadyCallback implements

AsyncCallback {

    public RenderAppWhenReadyCallback() {
        FacebookConnect.init(FacebookConstants.FACEBOOK_API_KEY,

“xd_receiver.htm”, loginCallback);
//SERVER
}

    public void onFailure(Throwable caught) {
        Window.alert("Unable to login through Facebook: " + caught);
    }

    public void onSuccess(ConnectState result) {
        if (result == ConnectState.connected) {
            isFacebookSign = true;

            for (FacebookObserver Observer : facebookObservers) {
                Observer.notifyFacebookLogin(true);
            }

            //History.newItem(HistoryConstants.USERHOME_PAGE_HISTORY_TOKEN);
        } else {
            //rightSideFlexTable.clearCell(0, 0);
            //rightSideFlexTable.setWidget(0, 0,

facebookPanel);
isFacebookSign = false;

        }
    }
};

Now we unable to found solution to this problem.

Can any one help Us to solve this problem ASAP

Hope-for the Best Co-operation

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:57:01+00:00Added an answer on May 15, 2026 at 9:57 pm

    we found solution for above Question.

    Facebook (login)loading requires few time.

    In Our web page we fetch fb details like fb users loggedInId ,Image,etc.
    so at the time of page loading we get all values null because facebook not load properly
    so we get $wnd.FB.Facebook.apiClient is null or

    Debug: Exception while loading FB.apiClient TypeError: $wnd.FB.Facebook is undefined”

    To solve this problem we write one method which calls when user refreshes page or after facebook loading done properly.

    public void notifyFacebookLogin(boolean isLogin) {

    Long fbLoggedInUserId = ApiFactory.getInstance().getLoggedInUser();

    if (fbLoggedInUserId != null) {

    if (globalEndUserInfo == null) {
        globalEndUserInfo = new EndUserInfo();
        globalEndUserInfo.setFbLoggedInUserId(fbLoggedInUserId);
      }
    

    }

    // code wherever we deal with FB related object

    }

    Now no error message display when user refreshes page or if fb takes time to loading

    In this way we solve our Problem. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 460k
  • Answers 460k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The solution I've been using to solve this problem is… May 15, 2026 at 11:49 pm
  • Editorial Team
    Editorial Team added an answer The problem that you are having is partly to do… May 15, 2026 at 11:49 pm
  • Editorial Team
    Editorial Team added an answer Well, I've found that SET NAMES isn't really all that… May 15, 2026 at 11:49 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.