java.lang.Object | ||
↳ | com.kinvey.android.push.AbstractPush | |
↳ | com.kinvey.android.push.GCMPush |
This functionality can be accessed through the push()
convenience method.
This class manages GCM Push for the current logged in user. Use `gcm.enabled=true` in the `kinvey.properties` file to enable GCM.
sample usage:kinveyClient.push().initialize(getApplicationContext());
This code snippet will enable push notifications through GCM for the current logged in user.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | GCMPush.PushConfig | This class is used to maintain metadata about the current GCM push configuration in the User collection. | |||||||||
class | GCMPush.PushConfigField | Manages ids and notificationKeys for PushConfig
|
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public static String[] | senderIDs |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GCMPush(Client client, boolean inProduction, String... senderIDs) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
disablePush()
Unregisters the current user with GCM and removes all _push fields from the current user object.
| ||||||||||
String |
getPushId()
Get the Registration ID from GCM for the Client's current application context.
| ||||||||||
String[] |
getSenderIDs()
Get a list of all sender IDs as an array
| ||||||||||
GCMPush |
initialize(Application currentApp)
Initialize GCM by registering the current user with both GCM as well as your backend at Kinvey.
| ||||||||||
GCMPush |
initialize(PushOptions options, Application currentApp)
Initialize GCM by registering the current user with both GCM as well as your backend at Kinvey.
| ||||||||||
boolean |
isInProduction()
Is GCM Push configured for production or a dev environment?
| ||||||||||
boolean |
isPushEnabled()
Check to see if the current user is registered for GCM.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Unregisters the current user with GCM and removes all _push fields from the current user object. Unregistration is asynchronous, so use the `KinveyGCMService` to receive notification when unregistration has completed.
PushRegistrationException |
---|
Get the Registration ID from GCM for the Client's current application context. Note if the current user is not registered, the registration ID will be an empty string.
Get a list of all sender IDs as an array
Initialize GCM by registering the current user with both GCM as well as your backend at Kinvey. Note these operations are performed asynchronously, however there is no callback. Instead, updates are delegated to your custom `KinveyGCMService` which will handle any responses.
currentApp | - The current valid application context. |
---|
Initialize GCM by registering the current user with both GCM as well as your backend at Kinvey. Note these operations are performed asynchronously, however there is no callback. Instead, updates are delegated to your custom `KinveyGCMService` which will handle any responses.
options | - deprecated, pass null . |
---|---|
currentApp | - The current valid application context. |
Is GCM Push configured for production or a dev environment?
Check to see if the current user is registered for GCM. This checks both with GCM directly as well as with a Kinvey backend. As registration occurs asynchronously, ensure your `KinveyGCMService` has received the onRegister call first.