Facebook login Xcode nothing happen

Hello everyone ,

i just started to use xcode for ios app programming so im pretty bad using it. I tried to just add a Facebook login button into my first app .It is loading it but when i click on it nothing happen. I followed this tutorial : https://developers.facebook.com/docs/facebook-login/ios/v2.4

This is my code :

//AppDelegate.h

 #import <UIKit/UIKit.h>
 #import <FBSDKCoreKit/FBSDKCoreKit.h> 
#import <FBSDKCoreKit/FBSDKCoreKit.h>
 #import <FBSDKLoginKit/FBSDKLoginKit.h> 
@interface AppDelegate : UIResponder <UIApplicationDelegate> 
@property (strong, nonatomic) UIWindow *window;
@end
//Appdelegate.m
#import "AppDelegate.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (void)applicationDidBecomeActive:(UIApplication *)application {
    [FBSDKAppEvents activateApp];
}
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    /
    [FBSDKLoginButton class];

    return YES;
}
- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {
    return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                          openURL:url
                                                sourceApplication:sourceApplication
                                                       annotation:annotation];
}
- (void)applicationWillResignActive:(UIApplication *)application {
    /
    /
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
    /
    /
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
    /
}
- (void)applicationWillTerminate:(UIApplication *)application {
    /
}
@end


//ViewController.h

#import <UIKit/UIKit.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
@interface ViewController : UIViewController
@end
//ViewController.m
#import "ViewController.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc] init];
    loginButton.center = self.view.center;
    [self.view addSubview:loginButton];
    /
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    /
}
@end



Any help would be more than appreciate.

Cheers guys

First, I've moved your post to Xcode > Getting Started because Xcode > Objective-C is for discussing the language itself rather than how to program with the language.

You wrote:

It is loading it but when i click on it nothing happen.

That's not much to go on. Have you tried setting a breakpoint in the code and stepping through it? That'll tell you, at a minimum, whether your code is running.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Facebook login Xcode nothing happen
 
 
Q