Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS doesn't call Facebook authentication callback

Tags:

ios

facebook

I'm making an facebook app by using Xcode4.2 and Facebook SDK latest version. I copied Hackbook to my app and replaced some method name. Then it worked ![enter image description here][1]

But when I click 'Okay' button, no response is happened. I checked details. Somehow iOS doesn't call OpenURL in appdelegate.m.

Why iOS doesn't call the method? Here's the code.

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    return [self.facebook handleOpenURL:url];
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    return [self.facebook handleOpenURL:url];
}

Please let me know what's happend.

Thanks in advance.

like image 404
Noriaki Takamizawa Avatar asked Feb 22 '23 00:02

Noriaki Takamizawa


1 Answers

Have you set your app's Facebook ID in your app's property list file? If you haven't, Facebook's app doesn't trigger the callback to your app.

Read the instructions here, in the section called "Modify the app property list file": https://developers.facebook.com/docs/mobile/ios/build/

Basically you need to create a new row in your app's plist named URL types, with a single item, URL Schemes, containing a single value, fbYOUR_APP_ID (the literal characters fb followed by your app ID).

like image 107
Greenwell Avatar answered Mar 08 '23 13:03

Greenwell