Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ ext {

supportLibVersion = '27.1.1'
googleLibVersion = '15.0.0'
googleLibVersionGCM = '12.0.1' // last version for GCM to be supported

firebaseJobdispatcherVersion = '0.8.5'

minSdkVersion = 14
Expand Down
17 changes: 4 additions & 13 deletions gcm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,12 @@ After these services are registered in the Manifest, you then need to register y
</intent-filter>
</receiver>
```
After all this, you will need to register for GCM in your `Application.onCreate()`, like so:

After this, you are all set. Adding the `parse-gcm-android` package will include a [ParseGCMJobService](https://github.com/parse-community/Parse-SDK-Android/blob/master/gcm/src/main/java/com/parse/gcm/ParseGCMJobService.java) 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:

```java
@Override
public void onCreate() {
super.onCreate();
Parse.Configuration configuration = new Parse.Configuration.Builder(this)
//...
.build();
Parse.initialize(configuration);
ParseGCM.register(this);
}
Parse.setLogLevel(Parse.LOG_LEVEL_DEBUG);
```
The sender ID should be all numbers. It is obtained via the Firebase console.

After this, you are all set.

## 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.
Expand Down
2 changes: 1 addition & 1 deletion gcm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {
}

dependencies {
api "com.google.android.gms:play-services-gcm:$googleLibVersion"
api "com.google.android.gms:play-services-gcm:$googleLibVersionGCM"
api "com.firebase:firebase-jobdispatcher:$firebaseJobdispatcherVersion"
implementation project(':Parse')
}
Expand Down