Appcelerator/ Titanium: Getting Android credentials to push notifications

放肆的年华 提交于 2019-12-02 07:41:18

I finally managed to get this to work. Basically the docs are heavily out of date.

The way I managed to get it to work is by linking the app to Firebase. From there I went to "Cog/ Settings" > "Cloud Messaging".

This shows your "Sender ID" (which is the same as your project number). For me this was a 12 digit number.

The page also shows a Server key and a Legacy server key. It does not seem to matter which one you use.

If you still receive the following error when pushing a notification:

Exception Type: GCM; Error Code: 3006; Error Message: The sender_id contained in the registration_id does not match the sender_id used to register with the GCM servers

simply uninstall the app and rebuild it.

SIDENOTE:

Linking your app to Firebase creates quite a few API keys automatically in your Google Console API credentials page named like "____ key (auto created by Google Service)".

The "Legacy server key" seems to match the one called: Server key (auto created by Google Service).

Note that just creating an API key yourself does not seem to work. It has to be the API key associated with Firebase.

When I did this I created an API Key, not an OAuth client ID. Same screens you had, but choose API Key from the Create credentials dropdown.

Here's a snip from my notes:

Create a Google API Project

The first step is creating a Google API project and enabling its GCM service. You also need to obtain a GCM sender ID and create a Google API server key.

create/edit a project from here : https://console.developers.google.com/project

After it is created, click the hamburger menu in the upper left, and Mouse over API Manager and choose Credentials

On the Credentials tab Click Create Credentials and choose API Key

copy it and paste it into the Arrow dashboard

Click hamburger menu - IAM & Admin -> Settings copy the project number - paste that into Arrow dashboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!