Hello I just follow link by @Oh Danny Boy
and I found this solution
from this thread : http://forum.developers.facebook.net/viewtopic.php?pid=303257#p303257
Fixed this by adding the following to webViewDidFinishLoad: in FBDialog.m
[_webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByName('cancel')[0].onclick = function onclick(event) { window.location.href = 'fbconnect://cancel'; return false;}"];
This makes the cancel button correctly call "fbconnect://cancel" rather than "fbconnect://success".
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[_webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByName('cancel')[0].onclick = function onclick(event) { window.location.href = 'fbconnect://cancel'; return false;}"];
[_spinner stopAnimating];
_spinner.hidden = YES;
self.title = [_webView stringByEvaluatingJavaScriptFromString:@"document.title"];
[self updateWebOrientation];
}
Its works fine:
But There is one more issue If Facebook Change html then this code will no longer work.
My solution to this problem is that :
Instead of putting JavaScript statically just get it from server at regular interval or similer mechanism
[_webView stringByEvaluatingJavaScriptFromString://We need to control this javascript from server//];
so in future we can change this javascript instead of updating whole application.
I hope in future this bug will be solved http://bugs.developers.facebook.net/show_bug.cgi?id=5958