它在Xcode 7.3.1和iOS 9.3的工作很好,但更新後的xcode它採空工作Facebook的登錄不ios10和Xcode中工作8
這裏的代碼,我已經使用
-(IBAction)ClickFacebook:(id)sender
{
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
[login
logInWithReadPermissions: @[@"public_profile",@"email"]
fromViewController:self
handler:^(FBSDKLoginManagerLoginResult *result, NSError *error)
{
if (error)
{
//NSLog(@"Process error");
FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc] init];
[loginManager logOut];
[FBSDKAccessToken setCurrentAccessToken:nil];
}
else if (result.isCancelled)
{
NSLog(@"Cancelled");
}
else
{
FBSDKGraphRequest *requestFB = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/me"
parameters:@{ @"fields": @"name,email"}
HTTPMethod:@"GET"];
[requestFB startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result,NSError *error)
{
//NSLog(@"%@",result);
NSString * strName=[result valueForKey:@"name"];
NSString * strEmail=[result valueForKey:@"email"];
// [[NSUserDefaults standardUserDefaults]setValue:strEmail forKey:@"EMAIL"];
// [[NSUserDefaults standardUserDefaults]setInteger:1 forKey:@"Logged_in"];
// [[NSUserDefaults standardUserDefaults]setValue:strName forKey:@"NAME"];
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
SignupJob *viewController = [sb instantiateViewControllerWithIdentifier:@"signupjob"];
viewController.strEmail=strEmail;
viewController.strName =strName;
[self.navigationController pushViewController:viewController animated:YES];
}];
}
}];
}
但在Facebook登錄後也不會回到返回本機應用程序時,我已經調試代碼,它落在
else if (result.isCancelled)
{
NSLog(@"Cancelled");
}
環和我有共同nsole錯誤就這樣
flow:finish_connect 2016-11-08 11:55:02.424070 OPT JOBS[2410:49655] [] nw_connection_endpoint_report [16 graph.facebook.com:443 ready resolver (satisfied)] reported event flow:finish_connect 2016-11-08 11:55:02.424919 OPT JOBS[2410:49661] [] __tcp_connection_start_block_invoke 16 sending event TCP_CONNECTION_EVENT_TLS_HANDSHAKE_COMPLETE in response to state ready and error (null) 2016-11-08 11:55:02.425626 OPT JOBS[2410:49661] [] tcp_connection_event_notify 16 event: TCP_CONNECTION_EVENT_TLS_HANDSHAKE_COMPLETE, reason: nw_connection event, should deliver: true 2016-11-08 11:55:02.426673 OPT JOBS[2410:49661] [] tcp_connection_get_statistics DNS: 18ms/24ms since start, TCP: 100ms/135ms since start, TLS: 211ms/343ms since start 2016-11-08 11:55:02.445829 OPT JOBS[2410:49655] [] nw_endpoint_flow_protocol_connected [17.1 31.13.78.13:443 in_progress socket-flow (satisfied)] Output protocol connected 2016-11-08 11:55:02.447545 OPT JOBS[2410:49655] [] nw_endpoint_flow_connected_path_change [17.1 31.13.78.13:443 ready socket-flow (satisfied)] 2016-11-08 11:55:02.448063 OPT JOBS[2410:49655] [] nw_endpoint_flow_connected_path_change [17.1 31.13.78.13:443 ready socket-flow (satisfied)] Connected path is satisfied 2016-11-08 11:55:02.448526 OPT JOBS[2410:49655] [] nw_endpoint_resolver_receive_report [17 graph.facebook.com:443 in_progress resolver (satisfied)] received child report:[17.1 31.13.78.13:443 ready socket-flow (satisfied)] 2016-11-08 11:55:02.448948 OPT JOBS[2410:49655] [] nw_connection_endpoint_report [17.1 31.13.78.13:443 ready socket-flow (satisfied)] reported event flow:finish_connect 2016-11-08 11:55:02.449428 OPT JOBS[2410:49655] [] nw_connection_endpoint_report [17 graph.facebook.com:443 ready resolver (satisfied)] reported event flow:finish_connect 2016-11-08 11:55:02.449908 OPT JOBS[2410:49558] [] __tcp_connection_start_block_invoke 17 sending event TCP_CONNECTION_EVENT_TLS_HANDSHAKE_COMPLETE in response to state ready and error (null) 2016-11-08 11:55:02.544663 OPT JOBS[2410:49558] [] tcp_connection_event_notify 17 event: TCP_CONNECTION_EVENT_TLS_HANDSHAKE_COMPLETE, reason: nw_connection event, should deliver: true 2016-11-08 11:55:02.545103 OPT JOBS[2410:49558] [] tcp_connection_get_statistics DNS: 11ms/18ms since start, TCP: 112ms/146ms since start, TLS: 220ms/362ms since start 2016-11-08 11:55:02.747101 OPT JOBS[2410:49551] [] nw_socket_handle_socket_event Event mask: 0x4 2016-11-08 11:55:02.747501 OPT JOBS[2410:49662] [] tcp_connection_cancel 16 2016-11-08 11:55:02.747984 OPT JOBS[2410:49551] [] nw_socket_handle_socket_event Socket received WRITE_CLOSE event 2016-11-08 11:55:02.748361 OPT JOBS[2410:49551] [] nw_endpoint_handler_cancel [16 graph.facebook.com:443 ready resolver (satisfied)] 2016-11-08 11:55:02.748705 OPT JOBS[2410:49551] [] nw_endpoint_handler_cancel [16.1 31.13.78.13:443 ready socket-flow (satisfied)] 2016-11-08 11:55:02.749132 OPT JOBS[2410:49551] [] __nw_socket_service_writes_block_invoke sendmsg(fd 9, 31 bytes): socket has been closed 2016-11-08 11:55:02.749475 OPT JOBS[2410:49551] [] nw_endpoint_flow_protocol_error [16.1 31.13.78.13:443 cancelled socket-flow (null)] Socket protocol sent error: [32] Broken pipe 2016-11-08 11:55:02.749751 OPT JOBS[2410:49551] [] nw_endpoint_flow_protocol_disconnected [16.1 31.13.78.13:443 cancelled socket-flow (null)] Output protocol disconnected 2016-11-08 11:55:02.750124 OPT JOBS[2410:49551] [] nw_resolver_cancel_on_queue 0x7a086580 2016-11-08 11:55:02.750463 OPT JOBS[2410:49551] [] -[NWConcrete_tcp_connection dealloc] 16 2016-11-08 11:55:02.867926 OPT JOBS[2410:49661] [] nw_socket_handle_socket_event Event mask: 0x4 2016-11-08 11:55:02.868244 OPT JOBS[2410:49558] [] tcp_connection_cancel 17 2016-11-08 11:55:02.868817 OPT JOBS[2410:49661] [] nw_socket_handle_socket_event Socket received WRITE_CLOSE event 2016-11-08 11:55:02.869206 OPT JOBS[2410:49661] [] nw_endpoint_handler_cancel [17 graph.facebook.com:443 ready resolver (satisfied)] 2016-11-08 11:55:02.869432 OPT JOBS[2410:49661] [] nw_endpoint_handler_cancel [17.1 31.13.78.13:443 ready socket-flow (satisfied)] 2016-11-08 11:55:02.869919 OPT JOBS[2410:49661] [] __nw_socket_service_writes_block_invoke sendmsg(fd 10, 31 bytes): socket has been closed 2016-11-08 11:55:02.870149 OPT JOBS[2410:49661] [] nw_endpoint_flow_protocol_error [17.1 31.13.78.13:443 cancelled socket-flow (null)] Socket protocol sent error: [32] Broken pipe 2016-11-08 11:55:02.870549 OPT JOBS[2410:49661] [] nw_endpoint_flow_protocol_disconnected [17.1 31.13.78.13:443 cancelled socket-flow (null)] Output protocol disconnected 2016-11-08 11:55:02.870896 OPT JOBS[2410:49661] [] nw_resolver_cancel_on_queue 0x7a08e1b0 2016-11-08 11:55:02.871251 OPT JOBS[2410:49661] [] -[NWConcrete_tcp_connection dealloc] 17
所以任何人都可以幫我找出ios10和Xcode的8
這個配置我已經做的這個原因BCS這是在ios9 –
工作試試這個代碼,我已經削減這從iOS的10認爲它應該在iOS的10個工作 – User511
你可以給我這個代碼在客觀上c –