diff --git a/build.gradle b/build.gradle index b18d976a5..ff49e3875 100644 --- a/build.gradle +++ b/build.gradle @@ -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 diff --git a/gcm/README.md b/gcm/README.md index c42d1abf3..2e9e868b0 100644 --- a/gcm/README.md +++ b/gcm/README.md @@ -68,21 +68,12 @@ After these services are registered in the Manifest, you then need to register y ``` -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. diff --git a/gcm/build.gradle b/gcm/build.gradle index 6834ab90f..6c7e1d5c3 100644 --- a/gcm/build.gradle +++ b/gcm/build.gradle @@ -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') }