Android - GCM服务器密钥不适用于Urban Airship [英] Android - GCM server key is not working with Urban Airship

查看:173
本文介绍了Android - GCM服务器密钥不适用于Urban Airship的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的android项目中整合Urban Airship Push通知服务。我在Google开发者控制台中创建了一个新项目,并创建了一个GCM服务器密钥。我在Urban Airship配置中添加了GCM密钥,但它失败了发送通知。

Urban Birship Error Console会抛出一个错误,如

 收到的推送无效授权平台GCM错误消息

我已在Google开发者控制台2个月后创建了一个测试项目并拥有有效的GCM密钥。如果我在UA中集成这个密钥,它可以正常工作。但是,如果我在不工作的同一个项目中创建新的服务器密钥。





API key 4 是最近创建的,但它在6月9日创建的服务器密钥无效。这是因为密钥是自动生成的吗?如果这是问题,我该如何自动创建GCM服务器密钥?

最近,我听说GCM正在迁移到Firebase。我需要使用FCM密钥代替GCM吗?

解决方案

似乎Google不再授权Google API创建的API密钥安慰。我与Amazon SNS有类似的问题,并设法通过使用Firebase自动生成的服务器密钥来解决此问题。


$ b 1 - 登录到 Google Firebase控制台,具有您用于Google API控制台的相同凭据。

2 - 创建一个新项目(或者导入现有的)。

3 - 点击齿轮图标并选择项目设置





4 - 选择 CLOUD MESSAGING 标签。



您将看到API服务器密钥和项目编号(在应用程序中需要) 。这个API服务器密钥是您需要在Push Provider控制台(您的案例中的Urban Airship)中引入的密钥。


I am trying to integrate Urban Airship Push notification service in my android project.I have created a new project in google developer console and created a GCM server key.I added that GCM key in Urban Airship configuration as well,but it fails to send the notification.

The Urban Airship Error Console throws an error like

Received push with invalid authorization on platform GCM error message

I already created a test project in google developer console 2 months back, and having a valid GCM key. If I integrate this key in UA it works fine. But If I create a new server key in same project that is not working.

API key 4 is recently created but it is not working the Server Key created on June 9th works fine. Is this because the key is auto generated? If that is the issue, how do I auto-create the GCM server key?

Recently, I heard that GCM is migrating to Firebase. Do I need to use FCM key instead of GCM?

解决方案

Seems that Google is no longer authorizing the API Keys created by Google API Console. I had a similar issue with Amazon SNS, and managed to fix it by using the Firebase auto-generated server key.

1 - Login into Google Firebase console, with the same credentials you used for Google API Console.
2 - Create a new project (or import an existing one).
3 - Click on the gear icon and select Project Settings

4 - Select CLOUD MESSAGING tab.

There you will see both the API Server Key and the Project number (which is needed in the application). This API Server key is the one you need to introduce in the Push Provider console (Urban Airship in your case).

这篇关于Android - GCM服务器密钥不适用于Urban Airship的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆