ios - 为 iOS 应用注册 GCM 时出错

标签 ios objective-c google-cloud-messaging cocoapods

我正在使用 Google instructions link将 GCM 与 iOS 应用集成。

我按照说明将 Cocoapod 文件集成到我的项目中。安装后,我在 GGLConfiguration.h 和 GGLInstanceID.h 中收到以下错误,如下图所示:

在 appdelegate.m 中添加以下代码片段时出现此问题

  #import "AppDelegate.h" 

 //***** this code *****//
  @interface AppDelegate ()
  @property(nonatomic, strong) void (^registrationHandler)
       (NSString *registrationToken, NSError *error);
  @property(nonatomic, assign) BOOL connectedToGCM;
  @property(nonatomic, strong) NSString* registrationToken;
  @property(nonatomic, assign) BOOL subscribedToTopic;
  @end


 and in appdelegate.h

 #import <Google/CloudMessaging.h>
  //***************/

enter image description here

如果有人遇到过类似的问题,请帮助我..

感谢任何帮助。

最佳答案

看起来您需要为您的 Objective-C 项目启用模块。

在您的build设置中,它看起来像这样:

更多信息可以看in this very related question .

附注

我不确定哪些模块被禁用与“1003”错误有关,顺便说一下。该错误来自代码的哪一部分?您是否有多个问题要组合在一起?

关于ios - 为 iOS 应用注册 GCM 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32044830/

相关文章:

ios - 当 ViewController(包含它)在后台时,'button.setImage' 不工作

ios - Theos:如何使用 block 参数 Hook 方法? (CDUnknownBlockType)

ios - 在 InterfaceBuilder 中启用/禁用 NSLayoutConstraints

android - 如何修复推送通知灰色圆圈错误?

ios - 我可以关闭仅在构建机器中使用的帐户的双因素身份验证吗?

objective-c - 使用NSString作为UIAlertView消息:

ios - 如何在 iOS9 中禁用 interactivePopGestureRecognizer

ios - 我添加了选项卡,但无法访问选项卡外的 View (ios)

android - GCM 消息传递确认

php - 如何从 php 向 Android 发送通知?