I have a project in XCode, which contains two targets, one at a lite version and the other to the full version. In both cases it requires the user to apply for permission to publish to Facebook.Both versions handle the same consumption Facebook ID.
In the full version opens a window asking for authorization of Facebook and if you authorize it, returns to the application whose I'm developing.
The Lite version is where the problem arises, it calls the authorization request window on Facebook, and if you press Authorize application does not return to the Lite app.
In both cases, the code is:
BOOL didOpenOtherApp = NO;
UIDevice *device = [UIDevice currentDevice];
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]];
}}
Thanks
I've got the same problem but i've solved using the Sharekit.. It's fantastic because you can share almost everywhere in just few lines of code and it's all done, this will make all you need for you..
Facebook, Twitter, Delicious, Instagram, Evernote and other services are already supported and if you don't care about this services, well, you can delete this file and the framework will work the same. Isn't it enough? You can make your own design with pre-imposted file in the framework to make this work the best with your app design..
Hope it helps!
精彩评论