Thursday, 26 May 2011

Facebook for iphone [login dialog]

For those developers who downloaded & worked with facebook plug-in with iphone, the login process is by default is like Gowalla. Where safari appeared & u login from there.
To show login dialog do these steps:-
1) Open facebook.m.
2) In function authorizeWithFBAppAuth, hash this block of code:-

if ([device respondsToSelector:@selector(isMultitaskingSupported)] && [device isMultitaskingSupported]) {
if (tryFBAppAuth) {
NSString *fbAppUrl = [FBRequest serializeURL:kFBAppAuthURL params:params];
didOpenOtherApp = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:fbAppUrl]];
}

if (trySafariAuth && !didOpenOtherApp) {
NSString *nextUrl = [NSString stringWithFormat:@"fb%@://authorize", _appId];
[params setValue:nextUrl forKey:@"redirect_uri"];

NSString *fbAppUrl = [FBRequest serializeURL:loginDialogURL params:params];
didOpenOtherApp = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:fbAppUrl]];
}
}

3) Enjoy:))

popovercontroller for iphone not shown

Of course all of u know that uipopovercontroller is not existed for iPhone..it's only for iPad.
So the solution i given thanx to PaulSolt here .
The problem faced me was in UITabBarController. So, the solution to the problem of popover not appeared is :-
1) Open WEPopOverController.m
2) In function presentPopOverFromRect, change the line [keyview addSubview:backgroundView];
to [theView addSubview:backgroundView];
3) enjoy:))