The FBConnects’s FBDialog class has a problem with the cancel button. When user taps the cancel button, the delegate method “dismissWithSuccess
” is called instead of “dialogDidCancel
“. This flaw in the FBConnect SDK makes it difficult to determine whether the user has tapped on cancel button or not.
We can overcome this issue by editing FBDialog.m in the FBConnect. Add the below code as the first line in FBDialog.m’s webViewDidFinishLoad :
methods
[_webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('cancel').onclick = function onclick(event) { window.location.href = 'fbconnect:cancel'; }"];
This should fix the issue and dialogDidCancel
should get called correctly..!