我正在尝试在 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/