简体   繁体   中英

Facebook Integration v4.0 Not Working for iPhone App

I'm a starter in iPhone application development. I'd like to implement 'Login With Facebook' Using my own customized UI.

I've tried all steps provided in Getting Started FB integration

I've tried to implement Login using FBSDKLoginManager forwhich suits for custom ui.

I've added all those things needed for FB integration. Added all necessary things in .plist file.

My App is running and Goes into the browser and asks for login. When i provide my credentials, then it asks for Profile access permission.

Upto this, i won't get any error. When i grant access to that request, i got the response as "Safari cannot open the Page. Because the address is invalid" in iOS Simulator and Empty blank space in FB app in iPad.

I won't get the control transfer back to my application. I've searched for this issue and won't get any proper response.

Can anybody assist me to get out of this issue?

I'm using Latest FacebookSDK v4.

I'll also provide my .plist file and Snapshots.

In my AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    return [[FBSDKApplicationDelegate sharedInstance] application:application
                                    didFinishLaunchingWithOptions:launchOptions];
}


- (void)applicationDidBecomeActive:(UIApplication *)application
{

    [FBSDKAppEvents activateApp];

}


- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

    return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                          openURL:url
                                                sourceApplication:sourceApplication
                                                       annotation:annotation];
}

.plist File Snapshot:

Info.plist文件快照

So kindly help to get out of this issue.. Or Give me the proper steps to implement the FB Login

Thanks in Advance.

I could only suggest you go through these steps, as I had some issues as well with the new Facebook SDK as well, but after double checking all their setup process again I managed to make it all work properly :

  1. Make sure you have your app created and listed at Facebook Applications

  2. If that's the case, then make sure your bundle id is added at the Facebook Developers page for that app and it also matches with the one you have inside your project

  3. Make sure the app is either public, or the account you are trying to log in with is listed in the roles page for your Facebook application at https://developers.facebook.com/apps/APPID/roles/

  4. Make sure you implement the FBSDKLoginButtonDelegate if you're using the native Facebook login button and also the delegate methods, load its class in the delegate and setting its permissions, OR properly implement FBSDKLoginManager , which I see it's your case.

  5. What I had problems with, but I see that you did not skipped, is having all the juicy stuff implemented in the Application Delegate , which I skipped, since I jumped directly at the Login implementation tutorial.

  6. Also critical are the three (3) values you need to add in your Info.plist with the Facebook App ID, Facebook Display Scheme and URL Schemes, but I can see that you already covered that as well.

I suggest going again through my first three steps I mentioned. Those (or just one) seem to be the root of your problem. Or not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM