Appcelerator titanium Android push notification GC

2019-02-11 07:43发布

问题:

i've setup push notification for Android and IOS in new project in Appcelerator studio , the IOS working fine , but the android not , my issue is the android devices token is successfully taken and registered but when i send a push from Appcelerator studio IOS success when Android failed.

I've enabled this API's in google developer console .

and created API key :

and i used the API key in Appcelerator ASC :

i don't understand why i can take the Android device token but i am not able to send push notification ?

回答1:

i found the solution the document of appcelerator is not updated yet

so here what you have to do

try the following sample code for devices registration :

https://gist.github.com/MotiurRahman/68bb7aad307901805b5f

Then Configuring push services for Android devices :

http://docs.appcelerator.com/platform/latest/#!/guide/Configuring_push_services-section-37551713_Configuringpushservices-ConfiguringpushservicesforAndroiddevices

With Firebase WEB API KEY and project ID

https://console.firebase.google.com/?pli=1

Get project_number (as Sender ID ) from JSON file and Web API KEY( as GCM API key ) from your firebase console.Now configure your dashboard for push notification

http://docs.appcelerator.com/platform/latest/#!/guide/Sending_and_Scheduling_Push_Notifications