I am working with a wrapper around the FB JS libs, which is actually 
running on a iPhone / PhoneGap that is calling the native FB Libs..

I have the following wrapper function that will log me out of FB and 
call the success function on return 

  public static native void logout (AsyncCallback<JavaScriptObject> 
callback) /*-{
     $wnd.FB.logout(function(response){
      
@com.gwtfb.client.core.FBCore::callbackSuccess(Lcom/google/gwt/user/client/rpc/AsyncCallback;Lcom/google/gwt/core/client/JavaScriptObject;)(callback,response);
   });
    }-*/;

The response method is defined below. During execution, the logout function 
just returns the 
String "OK".  From the diagnostics in the method below, obj is of class *
java.lang.String* and the 
callback signature is *protected class LoginStatusCallback implements 
AsyncCallback<JavaScriptObject> *

callback.onSuccess (obj); fails with a Class Cast Exception when running in 
Prod Mode,

The try / catch around callback.onSuccess (obj) does get caught and it 
successfully calls 
the callback with null as a parameter. it just seems off that the obj 
correctly identifies itself
as an instance of JavaScriptObject but fails on the call.. It works fine 
hosted mode..


Thank You
John Gentilin

  protected static void callbackSuccess(AsyncCallback<JavaScriptObject> 
callback, JavaScriptObject obj) 
  {
    m_Log.info("FB call response " + obj.toString());
    if (obj instanceof JavaScriptObject )
    {
      m_Log.info(obj.getClass().getName());
      if(callback != null)
      {
        try
        {
          m_Log.info(callback.getClass().getName());
          callback.onSuccess (obj);
        }
        catch(Exception e)
        {
          m_Log.info("Exception in callback, calling success with null");
          callback.onSuccess(null);
        }
      }
    }
    else
    {
      m_Log.info("Other than JavaScript Object returned on callback " 
+obj.getClass().getName());
    }
  }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/T_U-9Av-vBgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to