해결했습니다.
나는 FacebookSDK에서 SessionLoginSample을 검사했는데 해결책을 찾았습니다.
난에 코드 위에 변경했다 이것 : I가 MyAppDelegate.h
@property (strong, nonatomic) FBSession *session;
의 속성을 첨가 MyAppDelegate.m시키는 방법을 변경
MyAppDelegate *appDelegate = [[UIApplication sharedApplication]delegate];
if (!appDelegate.session.isOpen || appDelegate.session.state != FBSessionStateCreated) {
// Create a new, logged out session.
appDelegate.session = [[FBSession alloc] init];
}
// if the session isn't open, let's open it now and present the login UX to the user
[appDelegate.session openWithCompletionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
// and here we make sure to update our UX according to the new session state
[self sessionStateChanged:session state:status error:error];
}];
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication: (NSString *)sourceApplication annotation:(id)annotation
{
// return [FBSession.activeSession handleOpenURL:url];
return [FBAppCall handleOpenURL:url sourceApplication:sourceApplication withSession:self.session];
}
이제는 잘 작동합니다.
샌드 박스 모드를 사용할 수 없습니까? –
예. 시뮬레이터에서 작동합니다. –