我需要在我的应用中使用GoogleCloudMessaging。我通过Cocoapods安装它。 当我加入这部分代码:GoogleCloudMessaging关联错误
GLInstanceIDConfig *instanceIDConfig = [GGLInstanceIDConfig defaultConfig];
instanceIDConfig.delegate = self;
// Start the GGLInstanceID shared instance with the that config and request a registration
// token to enable reception of notifications
[[GGLInstanceID sharedInstance] startWithConfig:instanceIDConfig];
_registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken,
kGGLInstanceIDAPNSServerTypeSandboxOption:@YES};
[[GGLInstanceID sharedInstance] tokenWithAuthorizedEntity:GCMSSenderID
scope:kGGLInstanceIDScopeGCM
options:_registrationOptions
handler:_registrationHandler];
而且我有这些错误:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GGLInstanceID", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_GGLInstanceIDConfig", referenced from: objc-class-ref in AppDelegate.o "_kGGLInstanceIDAPNSServerTypeSandboxOption", referenced from: -[AppDelegate application:didRegisterForRemoteNotificationsWithDeviceToken:] in AppDelegate.o "_kGGLInstanceIDRegisterAPNSOption", referenced from: -[AppDelegate application:didRegisterForRemoteNotificationsWithDeviceToken:] in AppDelegate.o "_kGGLInstanceIDScopeGCM", referenced from: -[AppDelegate application:didRegisterForRemoteNotificationsWithDeviceToken:] in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
项目设置:
- >构建有源体系只有 - YES
- >其他链接标记包含$(继承)
- >部署t arget - 8.0
请帮帮我! 在此先感谢!
确保你正在构建的工作空间,而不是项目,因为的CocoaPods是在工作区中的另一个单独的项目 – user102008