私は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 SIGNIN:didSignInForUser:withError:' https://vinaymahipal.wordpress.com/tag/ios/これを見る –
と呼ばれるかどうか –