public abstract class

KinveyGCMService

extends GCMBaseIntentService
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ android.app.IntentService
           ↳ com.google.android.gcm.GCMBaseIntentService
             ↳ 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.

Summary

Constants
String MESSAGE_FROM_GCM
[Expand]
Inherited Constants
From class com.google.android.gcm.GCMBaseIntentService
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
boolean gcmEnabled()
String getAppKey()
String getAppSecret()
String getBaseURL()
String getSenderIDs()
boolean inProduction()
abstract void onDelete(int deleteCount)
This method is called when GCM messages are deleted.
void onDestroy()
void onError(Context context, String errorId)
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.
void registerWithKinvey(Client client, String gcmRegID, boolean register)
[Expand]
Inherited Methods
From class com.google.android.gcm.GCMBaseIntentService
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 Constructors

public KinveyGCMService ()

Public Constructor used by operating system.

Public Methods

public boolean gcmEnabled ()

public String getAppKey ()

public String getAppSecret ()

public String getBaseURL ()

public String getSenderIDs ()

public boolean inProduction ()

public abstract void onDelete (int deleteCount)

This method is called when GCM messages are deleted.

Parameters
deleteCount the number of deleted messages

public void onDestroy ()

public void onError (Context context, String errorId)

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.

public void registerWithKinvey (Client client, String gcmRegID, boolean register)