//

Facebook SDK iOS 6

Facebook SDK iOS 6 discussie in Ontwikkelen voor iOS forum; ( verdwijnt na registratie ) Hallo, Ik heb jullie hulp nodig, momenteel volg ik de Facebook SDK tutorial voor iOS. https://developers.facebook.com/docs/mobile/ios/build/ Na stap drie zou alles moeten werken, hij lijkt ...



Ga terug   iPhone, iPod touch, iPad en Apple TV forum > Development > Ontwikkelen voor iOS
Wachtwoord vergeten? Registreren!
Registreer FAQ Ledenlijst Kalender Berichten van vandaag

Reageren

 

Discussietools Weergave
  #1  
Oud 17-07-12, 19:01
JostiTosti JostiTosti is offline
• iOS 4.3.2
• Ik heb geen iPad
• Besturingssysteem: Mac OS X
 
Geregistreerd: Jul 2009
Locatie: Eindhoven
Berichten: 11
Standaard Facebook SDK iOS 6

Hallo,

Ik heb jullie hulp nodig, momenteel volg ik de Facebook SDK tutorial voor iOS.

https://developers.facebook.com/docs/mobile/ios/build/

Na stap drie zou alles moeten werken, hij lijkt het ook te doen. Je komt in het scherm om je app goed te keuren bij facebook. Daarna gaat die terug naar me app en blijft het hangen op een zwart scherm. De view controller wordt niet ingeladen. als foutmelding krijg ik:

"Application windows are expected to have a root view controller at the end of application launch"

Ik werk met iOS6 beta 2 en storyboard. Kan iemand van jullie mij opweeg helpen?

Code:
//
//  AppDelegate.m
//  fbtest
//
//  Created by Joost Pielage on 17-07-12.
//  Copyright (c) 2012 Fontys. All rights reserved.
//

#import "AppDelegate.h"
#import "ViewController.h"

@implementation AppDelegate

@synthesize window = _window, facebook;
@synthesize viewController = _viewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    
    static NSString* kAppId = @"475076652518607";
    
    facebook = [[Facebook alloc] initWithAppId:kAppId andDelegate:self];
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    if ([defaults objectForKey:@"FBAccessTokenKey"]
        && [defaults objectForKey:@"FBExpirationDateKey"]) {
        facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
        facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
    }
   
    if (![facebook isSessionValid]) {
            [facebook authorize:nil];
        }
    

   
    return YES;
}



// For iOS 4.2+ support
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    return [facebook handleOpenURL:url]; 
}

- (void)fbDidLogin {
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"];
    [defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"];
    [defaults synchronize];
    
}
							
- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end

Code:
//
//  AppDelegate.h
//  fbtest
//
//  Created by Joost Pielage on 17-07-12.
//  Copyright (c) 2012 Fontys. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "FBConnect.h"

@interface AppDelegate : UIResponder 
<UIApplicationDelegate, FBSessionDelegate>{
    UIViewController *viewController;
    Facebook *facebook;
}


@property (strong, nonatomic) UIWindow *window;
@property (nonatomic, retain) Facebook *facebook;
@property (nonatomic, retain) UIViewController *viewController;

@end
Advertentie
Advertentie Gesponsorde links (verdwijnt na registratie)

  #2  
Oud 18-07-12, 10:21
Whacko Whacko is offline
• iOS 7.1.2
• 5.1.1
• Besturingssysteem: Mac OS X
 
Geregistreerd: Jan 2009
Berichten: 484
Standaard

ik weet niet of dit het oplost, maar je hebt deze regel in je .m file:
@synthesize window = _window, facebook;

in het voorbeeld is een losse regel voor @synthesize facebook.

En anders heb je misschien in Storyboard je viewcontroller niet goed gekoppeld.
__________________
Software Engineer
iPhone Developer

Laatst gewijzigd door Whacko; 18-07-12 om 10:56.
Reageren



Er zijn 1 actieve gebruikers die momenteel deze discussie bekijken (0 leden en 1 gasten)

 

Soortgelijke discussies

Discussie Auteur Forum Reacties Laatste bericht
iOS Facebook SDK Jeroen0704 Ontwikkelen voor iOS 6 27-06-11 16:18

Regels voor berichten
Je mag geen nieuwe discussies starten
Je mag niet reageren op berichten
Je mag geen bijlagen versturen
Je mag niet je berichten bewerken

BB code is Aan
Smileys zijn Aan
[IMG]-code is Aan
HTML-code is Uit
Trackbacks are Aan
Pingbacks are Aan
Refbacks are Uit



Alle tijden zijn GMT +2. Het is nu 03:25.