SHARE
TWEET

Untitled

a guest Sep 16th, 2014 199 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         public FacebookWeb(final String appKey)
  2.         {
  3.                 this.appKey=appKey;
  4.                 ScriptInjector.fromUrl("http://connect.facebook.net/en_US/sdk.js").setCallback(new Callback<Void, Exception>(){
  5.                         public void onFailure(Exception e)
  6.                         {
  7.                                 Window.alert(e.getMessage());
  8.                         }
  9.                         public void onSuccess(Void result)
  10.                         {
  11.                                 initialize(appKey);
  12.                                 setInitialized();
  13.                         }
  14.                 });
  15.         }
  16.        
  17.         protected void setInitialized() {
  18.                 initialized=true;
  19.         }
  20.        
  21.         public boolean isInitialized()
  22.         {
  23.                 return initialized;
  24.         }
  25.  
  26.         private native void initialize(String appKey)
  27.         /*-{
  28.                
  29.                 $wnd.fbAsyncInit = function() {
  30.                   FB.init({
  31.                     appId      : appKey,
  32.                     xfbml      : true,
  33.                     version    : 'v2.0'
  34.                   });
  35.                 };
  36.         }-*/;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top