Search code examples
iphoneobjective-ciosfbconnect

Button Action on login Button click in FBConnect API


I am using fbconnect api in my project.When the login dialog gets opened where we entered our credentials ,when I click on login button there is something performed and it is redirected to the publish page. My problem is I am not getting which action is performed on that login button so that I can put an indicator over there.

I have attached a screenshot to specify which button I am talking about. enter image description here

Any suggestions will be highly appreciated!


Solution

  • Do you want to steal others' Facebook passwords? :)

    It seems, FBConnect uses UIWebView to load the pages from web. Those form elements are not created from the code. So you can not have the access to those methods/actions.


    Tracking the login button action using UIWebViewDelegate:

    In webView:shouldStartLoadWithRequest:navigationType: delegate method in FBDialog.m, you can see the request which are sent from the login view.

    You can read the URL by using [request.URL absoluteString]. Check if that URL contains the string https://www.facebook.com/login.php?m=m. If it is YES then probably a login request is being sent. You can do your action there.

    Note: I am not sure this will always work. You can do further research to find a better solution.