【问题标题】:Android GCM - New Google API ConsoleAndroid GCM - 新的 Google API 控制台
【发布时间】:2013-12-13 12:04:05
【问题描述】:

我使用 GCM 很长时间,但使用新的 Google 控制台界面,行为有点不同。

您必须创建项目并获取项目 ID。这是 GCM 发件人 ID。没关系。

但之后你必须创建应用程序。

GCM 文档说要创建一个应用程序,然后单击“Android > 直接从 Android 访问 API”。

这里的文档:http://developer.android.com/google/gcm/gs.html

这应该是在服务器中发送消息的 API KEY,但它不起作用。

但如果我创建一个 Web 应用程序并获得 "> 服务器密钥 > API 密钥",它就可以工作!

这有意义吗?谢谢

【问题讨论】:

    标签: android push-notification google-cloud-messaging


    【解决方案1】:

    我遵循了 Android 指定的确切步骤,它完全按照他们所说的那样工作。

    获取 API 密钥:

    1. In the sidebar on the left, select APIs & auth > Registered apps.
    2. Click Register app.
    3. In the Name field, type your app's name.
    4. Click Android > Accessing APIs directly from Android.
    5. Under Android identification, type the package name for your app.
    6. Enter an SHA1 fingerprint. To get this value, follow the instructions in the
       console help.
    7. Click Register.
    8 .In the new page, open the Android Key section and copy the API key. You will need
       the API key later on to perform authentication in your application server.
    

    我通过以下命令获得了 SHA1 指纹:

    keytool -exportcert -alias androiddebugkey -keystore C:\Users\myusername\.android\debug.keystore -list -v

    (和密码android

    【讨论】:

    • 是的,我遵循了这两个步骤。但正如我所说,它没有用。但是,如果我将密钥创建为 Web 应用程序,并获得 SERVER KEY 它就可以工作。
    • 我无法在服务器中发送消息,它说密钥无效。
    猜你喜欢
    • 1970-01-01
    • 2017-01-11
    • 2019-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-02
    • 1970-01-01
    相关资源
    最近更新 更多