Coder Social home page Coder Social logo

gcmpush's Introduction

Titanium Module for Google Cloud Messaging Push Notifications for Android

A Titanium module for registering a device with GCM and handling push notifications sent to the device.

  1. Install the module as usual in Titanium Studio by downloading the zip file
  2. Refer to the example for possibilities
  3. Send a server push notification with your preferred server-side technology to the registrationId returned while registering your device.
  4. The callback you specified will then be called

This module does not require any tiapp.xml properties, all configuration is done in Javascript.

There are four notification settings that can be specified:

  1. sound: the sound file to play while receiving the notification or 'default' for the default sound. The sound file should be placed in platform/android/res/raw directory.
  2. smallIcon: the tiny icon shown at the top of the screen, see this stackoverflow question for details. The file should be placed in platform/android/res/drawable
  3. largeIcon: the large icon shown in the notification bar. If not specified your appicon will be used. The file should be placed in platform/android/res/drawable.
  4. vibrate (true / false): whether vibration should be on

If the app is not active when the notification is received, use gcm.getLastData() to retrieve the contents of the notification and act accordingly to start or resume the app in a suitable way. If you're done, call gcm.clearLastData(), otherwise the same logic will happen when resuming the app again.

gcmpush's People

Contributors

morinel avatar

Watchers

Dan Tamas avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.