Jawnnypoo Cleanup (#861)
* Remove unneeded throws calls and remove some deprecated methods

* Fix lint warnings, including javadocs, redundant initializers, and more

* Remove some outdated things from the contributing doc

* Fix potential null pointer exception within the push broadcast receiver

* Add findAll to ktx and make extension functions inline

* Remove more unused methods and inspection warnings

* Update dependencies and remove unused class
Latest commit 0cfc67e Jul 26, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/main Cleanup (#861) Jul 25, 2018
.gitignore Move GCM out into its own module Apr 25, 2018
README.md Add KTX module (#860) Jul 23, 2018
build.gradle Formatting (#855) Jul 23, 2018
proguard-rules.pro Move GCM out into its own module Apr 25, 2018


Parse SDK Android GCM

GCM support for Parse Android apps


Please note that GCM is deprecated in favor of FCM. This module exists as a backwards compatible solution for projects already using GCM. New apps should instead use FCM.



After including JitPack:

dependencies {
    implementation "com.github.parse-community.Parse-SDK-Android:parse:latest.version.here"
    implementation "com.github.parse-community.Parse-SDK-Android:gcm:latest.version.here"

You will then need to register some things in your manifest, firstly, the GCM sender ID:

    android:value="id:YOUR_SENDER_ID_HERE" />

The sender ID should be all numbers. Make sure you are keeping the id: in the front.

Next you will register the GcmReceiver:

    android:permission="com.google.android.c2dm.permission.SEND" >
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        <category android:name="${packageName}" />

And to listen for the pushes from GCM:

    android:exported="false" >
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />

And finally, to register the device for GCM pushes:

        <action android:name="com.google.android.gms.iid.InstanceID" />

After these services are registered in the Manifest, you then need to register your push broadcast receiver:

        <action android:name="com.parse.push.intent.RECEIVE" />
        <action android:name="com.parse.push.intent.DELETE" />
        <action android:name="com.parse.push.intent.OPEN" />

After this, you are all set. Adding the parse-gcm-android package will include a ParseGCMJobService in the AndroidManifest.xml file that will register for a GCM token when the app starts. You should see ParseGCM: GCM registration success messages assuming you have enabled logging:


Custom Notifications

If you need to customize the notification that is sent out from a push, you can do so easily by extending ParsePushBroadcastReceiver with your own class and registering it instead in the Manifest.


Copyright (c) 2015-present, Parse, LLC.
All rights reserved.

This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.