Search code examples
androidpush-notificationappceleratorappcelerator-titaniumappcelerator-mobile

Where to put google-services.json in Titanium project?


I am working on the push notification for Android app using Titanium. I have already created the GCM Server API key and Sender ID. And downloaded the configuration file

google-services.json

where should I put this file into my Titanium project?


Solution

  • Adding google-services.json is a convenience step for native apps for easy GCM/ FCM integration.

    For integrating push notifications to Titanium project, you have to first decide how you would like to send your notifications. There are services like Arrow Push and Firebase Notifications that allow you to send notification from a graphical web console.

    If you want to go ahead with Arrow Push you may check Titanium CloudPush Module

    The CloudPush module supports Android push notifications for a device by providing a connection to the push notification server to the device to receive push notifications and to optionally present a tray notification to the user when a new push notification is received.

    In your project's tiapp.xml, you need to add some keys to configure push notifications.

    <!-- Property keys for Arrow Push (required) -->
    <property name="acs-api-key-development" type="string">YOUR DEVELOPMENT API KEY HERE</property>
    <property name="acs-api-key-production" type="string">YOUR PRODUCTION API KEY HERE</property>
    <property name="acs-api-key" type="string">YOUR API KEY HERE</property>
    

    For integrating Firebase Notifications, not sure if we have a good Firebase Titanium android module yet. Appcelerator / Titanium module project exists to build and use the Firebase SDK but it doesn't integrate Firebase notifications as per this issue.

    There are few Titanium GCM modules also, you'll have to see how you can provide GCM sender id/ key in these modules.