Xcode 8.0을 사용하고 iOS 10.0에서 테스트하고 SDK 인 GoogleSignIn/GoogleSignIn.h를 수동으로 설치하여 사용 중입니다.Google 로그인 앱이 IOS (Objective C)에서 충돌 함
성공적으로 앱 내가
오류 아래에 언급 crashing.Error 메시지입니다 로그인 후 :
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[pinakinAudioListViewController signIn:didSignInForUser:withError:]: unrecognized selector sent to instance 0x7fc44e863c00' *** First throw call stack: ( 0 CoreFoundation 0x000000010229034b exceptionPreprocess + 171 1 libobjc.A.dylib
0x000000010596121e objc_exception_throw + 48 2 CoreFoundation
0x00000001022fff34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 CoreFoundation 0x0000000102215a2e ___forwarding_ + 526 4 CoreFoundation 0x0000000102215798 _CF_forwarding_prep_0 + 120 5 Pinakin
0x0000000100e517af 37-[GIDSignIn addCallDelegateCallback:]_block_invoke + 116 6 Pinakin
0x0000000100e49981 -[GIDCallbackQueue fire] + 147 7 Pinakin
0x0000000100e5735b -[GIDTokenFetchDelegate didFinishTokenFetchWithAuth:fetcher:error:] + 53 8 CoreFoundation
0x000000010221705c __invoking_ + 140 9 CoreFoundation
0x0000000102216ee1 -[NSInvocation invoke] + 289 10 Pinakin
0x0000000100e5c771 +[GTMOAuth2Authentication invokeDelegate:selector:object:object:object:] + 207 11 Pinakin
0x0000000100e5ba79 -[GTMOAuth2Authentication tokenFetcher:finishedWithData:error:] + 648 12 CoreFoundation
0x000000010221705c invoking_ + 140 13 CoreFoundation
0x0000000102216ee1 -[NSInvocation invoke] + 289 14 Pinakin
0x0000000100e61bd3 67-[GTMSessionFetcher completionHandlerWithTarget:didFinishSelector:]_block_invoke + 268 15 Pinakin 0x0000000100e692c5 __71-[GTMSessionFetcher invokeFetchCallbacksOnCallbackQueueWithData:error:]_block_invoke + 25 16 libdispatch.dylib 0x00000001064ff980 _dispatch_call_block_and_release + 12 17 libdispatch.dylib 0x00000001065290cd _dispatch_client_callout + 8 18 libdispatch.dylib 0x0000000106509a1d _dispatch_main_queue_callback_4CF + 733 19 CoreFoundation 0x00000001022544f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 20 CoreFoundation 0x0000000102219f8d __CFRunLoopRun + 2205 21 CoreFoundation 0x0000000102219494 CFRunLoopRunSpecific + 420 22 GraphicsServices
0x00000001081c2a6f GSEventRunModal + 161 23 UIKit
0x0000000103449f34 UIApplicationMain + 159 24 Pinakin
0x0000000100daa00f main + 111 25 libdyld.dylib
0x000000010657568d start + 1 26 ???
0x0000000000000001 0x0 + 1) libc++abi.dylib: terminating with uncaught exception of type NSException
는 내가이 코드
GIDSignIn *sigNIn=[GIDSignIn sharedInstance];
[sigNIn setDelegate:self];
[sigNIn setUiDelegate:self];
sigNIn.shouldFetchBasicProfile = YES;
sigNIn.scopes = @[@"https://www.googleapis.com/auth/userinfo.email",@"https://www.googleapis.com/auth/userinfo.profile"];
sigNIn.clientID [email protected]"851647387203-6n9vm1jpn8uv2c0g1qsrdi4nn69f8rh5.apps.googleusercontent.com";
[sigNIn signIn];
AppDelegate에
에서- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
BOOL wasHandled=false;
if ([url.scheme hasPrefix:@"fb"]) {
wasHandled = [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation
];
//Facebook callback
}
else //Google Plus callback
{
wasHandled= [[GIDSignIn sharedInstance] handleURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
NSLog (@"application openURL");
NSLog (@"URL = %@", url);
NSLog (@"Application = %@", sourceApplication);
return wasHandled;
}
를 사용하여 사용자 정의 로그인을 생성
확인 한 번 pinakinAudioListViewController''의 대리자 메서드 '로그인의 : didSignInForUser : withError' 방법'pinakinAudioListViewController 로그인 절차 : didSignInForUser : withError은'이라고 여부를 –
이 볼 https://vinaymahipal.wordpress.com/tag/ios/ –