Oll*_*e C 11 android google-api google-cloud-messaging google-play-services
该应用使用Google Cloud Messaging并包含一个google-services.json文件,该文件本身包含Google API身份验证信息,包括API密钥.GCM按预期运行.
该应用程序包含一个使用HTTP发送GCM消息的测试工具,它需要API密钥.如何访问存储在google-services.json中的密钥?我不想使用GoogleCloudMessaging发送消息(我正在使用OkHttp,它可以很好地完成工作).
希望没有必要在应用程序中复制它.
mar*_*rna 26
对不起,这里游戏有点晚了......
该google-services.json文件将被解析,其值将添加到xml您有权访问的文件中:https:
//developers.google.com/android/guides/google-services-plugin
在您的情况下,您可以获得api密钥:
activity.getResources().getString(R.string.google_api_key);