在 iOS 应用程序中集成 Google Plus

Integrating Google Plus in iOS application

我正在尝试集成 Google Plus 身份验证,并遵循了 this link 中的教程。

当我添加 #import "GPPSignIn.h" 时出现错误:

GPPSignIn.h not found.

但是,当我使用 #import "/Users/MH/Documents/TestGooglePlus/GooglePlus.framework/Headers/GPPSignIn.h" 时它有效。

编译后我的应用程序崩溃了,我收到了这条消息:

-[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x7fc71b568010

听起来你有两个问题。

首先,header.

参见:https://developers.google.com/+/mobile/ios/sign-in#enable_sign_in

#import <GooglePlus/GooglePlus.h>
#import <GoogleOpenSource/GoogleOpenSource.h>

其次,您遗漏了一个重要的链接器标志。

参见:https://developers.google.com/+/mobile/ios/getting-started#step_2_initialize_the_google_client

步骤 6.2:

Add the ObjC linker flag to the app target's build settings:

Other Linker Flags: -ObjC