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 ...
|
Registreer | FAQ | Ledenlijst | Kalender | Berichten van vandaag | Zoeken |
#1
|
|||
|
|||
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 |
|
|
Gesponsorde links (verdwijnt na registratie)
|
#2
|
|||
|
|||
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 11:56. |
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 17:18 |
|
|