为什么需要将配置文件添加到项目中才能正确设置GCM? [英] Why do I need to add the configuration file to my project to set up GCM correctly?
问题描述
https://developers.google.com/cloud-messaging/android/client 我已经读过这篇文章.它说我需要下载配置文件并将其添加到我的项目中.但是他们没有解释,我为什么要这样做?不添加配置文件就行吗?
https://developers.google.com/cloud-messaging/android/client I've read this article. And it says that I need to download and add the configuration file to my project. But they do not explain, why should I do this? Won't it work without adding the configuration file?
推荐答案
我还在从事多个GCM项目,但仍在使用Eclipse,Eclipse-ADT-plugin和旧项目结构,并且我没有包含此配置文件进入我的项目.一开始我也很困惑,因此在使用Gradle的Android-Studio项目中尝试了它,但是配置文件也不是必需的.
I am also working on multiple GCM-projects but still using Eclipse, Eclipse-ADT-plugin and the old project structure and I did not include this config-file into my projects. I also was confused at the beginning and hence tried it in a Android-Studio project using Gradle but the config file was not necessary either.
所以雷蒙德(Rémond)的答案可能很有意义,但对我而言一切正常(包括生成InstanceID-Token,并且主题消息也在运行).
So Rémond´s answer might make sense but for me everything is working fine (including generating InstanceID-Token and also Topic-Messaging is working).
因此,实际上,它无需添加文件即可工作,而且您也不需要此文件.
So in fact, it should work without adding the file and you do not need this file anyway.
这篇关于为什么需要将配置文件添加到项目中才能正确设置GCM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!