public abstract class

KinveyGCMService

extends IntentService
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ android.app.IntentService
           ↳ com.kinvey.android.push.KinveyGCMService

Class Overview

IntentService responsible for handling GCM messages.

Upon successful registration/unregistration with GCM, this class will perform the appropriate action with Kinvey as well.

To use GCM for push notifications, extend this class and implement the provided abstract methods. When GCM related events occur, they relevant method will be called by the library.

Summary

Constants
String MESSAGE_FROM_GCM
String REGISTERED
String REG_ID
String TAG
String TRIGGER
String UNREGISTERED
[Expand]
Inherited Constants
From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2
Public Constructors
KinveyGCMService()
Public Constructor used by operating system.
Public Methods
abstract Class getReceiver()
abstract void onDelete(String deleted)
This method is called when GCM messages are deleted.
abstract void onError(String error)
This method is called when an error occurs with GCM.
abstract void onMessage(String message)
This method is called when a message is received through GCM via Kinvey.
abstract void onRegistered(String gcmID)
This method is called after successful registration.
abstract void onUnregistered(String oldID)
This method is called after successful unregistration.
[Expand]
Inherited Methods
From class android.app.IntentService
From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.content.ComponentCallbacks2

Constants

public static final String MESSAGE_FROM_GCM

Constant Value: "msg"

public static final String REGISTERED

Constant Value: "REGISTERED"

public static final String REG_ID

Constant Value: "REGID"

public static final String TAG

Constant Value: "KINVEY-GCM"

public static final String TRIGGER

Constant Value: "KINVEY_ACTION"

public static final String UNREGISTERED

Constant Value: "UNREGISTERED"

Public Constructors

public KinveyGCMService ()

Public Constructor used by operating system.

Public Methods

public abstract Class getReceiver ()

public abstract void onDelete (String deleted)

This method is called when GCM messages are deleted.

public abstract void onError (String error)

This method is called when an error occurs with GCM.

Parameters
error the text of the error message

public abstract void onMessage (String message)

This method is called when a message is received through GCM via Kinvey.

Parameters
message the text of the message

public abstract void onRegistered (String gcmID)

This method is called after successful registration. This includes both registering with GCM as well as Kinvey.

Parameters
gcmID the new user's unique GCM registration ID

public abstract void onUnregistered (String oldID)

This method is called after successful unregistration. This includes removing push from both GCM as well as Kinvey.

Parameters
oldID the old GCM registration ID of the now unregistered user.