Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Introducing DreamFactory's Google Cloud Messaging Service

DZone's Guide to

Introducing DreamFactory's Google Cloud Messaging Service

DreamFactory will now let you integrate with Google's Cloud Messaging (GCM) service. It's easy to configure DreamFactory as your Android app’s push notification provider.

· Integration Zone
Free Resource

Share, secure, distribute, control, and monetize your APIs with the platform built with performance, time-to-value, and growth in mind. Free 90-day trial of 3Scale by Red Hat

DreamFactory 2.5 now supports the Google Cloud Messaging Service (GCM). This blog post will show you how easy it is to configure DreamFactory as your Android app’s push notification provider. Note that GCM support is a premium feature in DreamFactory's Silver and Gold products — not an open-source feature.

GCM is a native DreamFactory service that supports role-service-access, live API documentation, script access, etc. Once you've configured GCM in DreamFactory, all the configuration details are hidden from your client. They are securely stored in your DreamFactory instance database. This provides a simple way for your Android application to send push notifications with DreamFactory.

Configuring a GCM service is as easy as configuring any other services in the DreamFactory admin console. Start by logging into the admin console, head over to the Services tab, and click on the Create button on the left sidebar. Use the Service Type drop-down to select Notification > GCM Push Notification, complete the service configuration form, and save it to create your service. 

In the Info tab, provide basic service information (name, label, and description).

Image title

Then, in the Config tab, provide the following configuration information:

  • API key: String. Required. Enter you GCM server API Key here.
  • Environment: String. Required. Select your Android application environment (Development or Production).
  • Service event: Array. Optional. Here, you can tie this GCM service to any number of system events. In the example below we have tied our GCM service with two events: system.admin.session.post and system.admin.session.delete. These events are fired respectively when a system admin logs in and logs out of the DreamFactory. It automatically fires this GCM service and sends a push notification to targeted devices. You can enter the push notification message in the Message field.

Image title

Once you've configured your GCM service, head over to the API Docs tab and expand your newly created service to see the API endpoints that are ready to use. You can learn more about these endpoints in the DreamFactory docs.

Image title

In this post, we quickly covered how simple it is to use DreamFactory to manage and send Android push notifications with the Google Cloud Messaging Service. Head on over to the community forum to discuss or let us know what you think in the comments! 

Explore the core elements of owning an API strategy and best practices for effective API programs. Download the API Owner's Manual, brought to you by 3Scale by Red Hat

Topics:
dreamfactory ,google ,cloud messaging ,integration ,gcm

Published at DZone with permission of Arif Islam. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}