c++ - 使用 cocoapods 在 iOS 上集成 GoogleCloudMessaging

标签 c++ ios xcode cocos2d-x cocoapods

我正在尝试在 iOS 项目上集成 GoogleCloudMessaging(GCM)。 (Cocos2d-x v3.2) 根据谷歌的说明,(https://developers.google.com/cloud-messaging/ios/client) 我使用 cocoapods 但失败并出现以下错误。

$ pod install
Updating local specs repositories
Analyzing dependencies
[!] Unable to satisfy the following requirements:

- `GoogleCloudMessaging` required by `Podfile`

这是我测试过的。

  • 在 cocos2dx 项目 (v3.2) 上安装 GCM -> 失败。
  • 创建一个非cocos2dx项目并安装GCM -> 成功
  • 在 cocos2dx 项目上安装 GoogleAnalytics -> 成功。
  • 使用 v3.7 创建一个 cocos2dx 项目并安装 GCM -> 失败。

我还不知道为什么安装 GCM 失败但 GoogleAnalytics 却没有。 有没有人在 iOS 上成功集成 GCM?

编辑

这是我的 Pod 文件

# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
source 'https://github.com/CocoaPods/Specs.git'
target 'SampleApp iOS' do
        pod 'GoogleCloudMessaging'
end

target 'SampleApp Mac' do
end

最佳答案

我可以引用 cocos2d-x 论坛中的帖子来解决这个问题。 在 Xcode 项目设置中将 Deployment Target 更改为 7.0 或更高版本将清除此问题。

关于c++ - 使用 cocoapods 在 iOS 上集成 GoogleCloudMessaging,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31960655/

相关文章:

ios - 2个纵向和横向 Storyboard

c++ - 如何在C++中实现快速排序算法

c++ - 如何从文件中识别数据类型

c++ - 如何编写与此汇编代码相同的 C/C++ 代码?

c++ - 在 C++ 中按值传递临时结构的简单方法?

ios - 使用线程和核心数据时出错(objective-c)

xcode - 读取 UITableView Section Title 的字符串值

iphone - iOS 上的 ImageMagick 圆形扭曲

ios - API 调用阻塞 UI 线程 Swift

ios - Xcode - 无法重新创建证书和签名配置文件