Skip to content

Commit afd3335

Browse files
authored
Fix README (#818)
1 parent 23c1dee commit afd3335

File tree

1 file changed

+63
-11
lines changed

1 file changed

+63
-11
lines changed

README.md

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,73 @@ A library that gives you access to the powerful Parse cloud platform from your A
1212
For more information about Parse and its features, see [the website][parseplatform.org], [blog][blog] and [getting started][guide].
1313

1414
## Getting Started
15+
1516
### Installation
1617
- **Option 1:** Gradle
1718

1819
Add dependency to the application level `build.gradle` file.
1920

21+
```groovy
22+
ext {
23+
parseVersion = "1.17.0"
24+
}
25+
```
26+
2027
```groovy
2128
dependencies {
22-
implementation 'com.parse:parse-android:1.16.7'
29+
implementation "com.parse:parse-android:$parseVersion"
30+
31+
// Add for push notification support -- add FCM or GCM but not both.
32+
implementation "com.parse:parse-fcm-android:$parseVersion" // migrate to FCM
33+
// implementation "com.parse:parse-gcm-android:$parseVersion" // deprecated GCM support
34+
2335
}
2436
```
2537

38+
#### Migrating to Firebase
39+
40+
If you are upgrading from a previous Parse SDK version and rely on push notifications, it is highly recommended you migrate to Firebase Cloud Messaging (FCM) since Google has announced it will be deprecated in April 2019. To migrate to FCM, you will only need to make changes to the client. No changes are needed on the Parse Server side.
41+
42+
Verify you have done the following:
43+
44+
- [ ] Added app to [Firebase console](https://console.firebase.google.com/u/0/).
45+
- [ ] Added the `com.google.gms.google-services` Gradle plugin (see [setup guide](https://firebase.google.com/docs/android/setup))
46+
47+
```groovy
48+
buildscript {
49+
// ...
50+
dependencies {
51+
// ...
52+
classpath 'com.google.gms:google-services:3.2.1' // google-services plugin
53+
}
54+
}
55+
56+
allprojects {
57+
// ...
58+
repositories {
59+
// ...
60+
maven {
61+
google() // Google's Maven repository
62+
}
63+
}
64+
}
65+
```
66+
67+
- [ ] Downloaded and added [google-services.json](https://support.google.com/firebase/answer/7015592) to your `app/` dir from your Firebase app.
68+
- [ ] Added `ParseFirebaseInstanceIdService` and `ParseFirebaseMessagingService` to your `AndroidManifest.xml` file (see [docs](http://docs.parseplatform.org/tutorials/android-push-notifications/))
69+
- [ ] Removed `GcmBroadcastReceiver`, `PushService`, `com.parse.push.gcm_sender_id` if upgrading from GCM.
70+
71+
Assuming these major steps are done, adding the `parse-fcm-android` package will automatically instantiate a [ParseFirebaseJobService](https://github.com/parse-community/Parse-SDK-Android/blob/master/fcm/src/main/java/com/parse/fcm/ParseFirebaseJobService.java) that will register for a FCM token when the app starts. See the setup instructions below to verify that FCM registration works.
72+
2673
- **Option 2:** Compiling for yourself into AAR file
2774
2875
If you want to manually compile the SDK, begin by cloning the repository locally or retrieving the source code for a particular [release][releases]. Open the project in Android Studio and run the following commands in the Terminal of Android Studio:
29-
76+
3077
```
3178
./gradlew clean build
3279
```
3380
Output file can be found in `Parse/build/outputs/` with extension .aar
34-
81+
3582
You can link to your project to your AAR file as you please.
3683
3784
@@ -45,6 +92,11 @@ Initialize Parse in a custom class that extends `Application`:
4592
@Override
4693
public void onCreate() {
4794
super.onCreate();
95+
96+
// Remove for production, use to verify FCM is working
97+
// Look for ParseFCM: FCM registration success messages in Logcat to confirm.
98+
Parse.setLogLevel(Parse.LOG_LEVEL_DEBUG);
99+
48100
Parse.initialize(new Parse.Configuration.Builder(this)
49101
.applicationId("YOUR_APP_ID")
50102
.clientKey("YOUR_CLIENT_KEY")
@@ -54,9 +106,9 @@ Initialize Parse in a custom class that extends `Application`:
54106
}
55107
}
56108
```
57-
109+
58110
The custom `Application` class must be registered in `AndroidManifest.xml`:
59-
111+
60112
```xml
61113
<application
62114
android:name=".App"
@@ -93,15 +145,15 @@ Add the Maven link in your root `build.gradle` file:
93145
}
94146
}
95147
```
96-
148+
97149
Add the dependency to your `app/build.gradle`:
98150

99151
```groovy
100152
dependencies {
101153
implementation 'com.github.parse-community:Parse-SDK-Android:master-SNAPSHOT'
102154
}
103155
```
104-
156+
105157
## How Do I Contribute?
106158
We want to make contributing to this project as easy and transparent as possible. Please refer to the [Contribution Guidelines][contributing].
107159

@@ -130,7 +182,7 @@ As of April 5, 2017, Parse, LLC has transferred this code to the parse-community
130182

131183
[latest]: https://search.maven.org/remote_content?g=com.parse&a=parse-android&v=LATEST
132184
[snap]: https://oss.jfrog.org/artifactory/oss-snapshot-local/com/parse/parse-android/
133-
185+
134186
[bintray-svg]: https://api.bintray.com/packages/parse/maven/com.parse:parse-android/images/download.svg
135187
[bintray-link]: https://bintray.com/parse/maven/com.parse:parse-android
136188

@@ -141,13 +193,13 @@ As of April 5, 2017, Parse, LLC has transferred this code to the parse-community
141193

142194
[build-status-svg]: https://travis-ci.org/parse-community/Parse-SDK-Android.svg?branch=master
143195
[build-status-link]: https://travis-ci.org/parse-community/Parse-SDK-Android
144-
196+
145197
[coverage-status-svg]: https://img.shields.io/codecov/c/github/parse-community/Parse-SDK-Android/master.svg
146198
[coverage-status-link]: https://codecov.io/github/parse-community/Parse-SDK-Android?branch=master
147-
199+
148200
[parseui-link]: https://github.com/parse-community/ParseUI-Android
149201
[parselivequery-link]: https://github.com/parse-community/ParseLiveQuery-Android
150-
202+
151203
[parsefacebookutils-link]: https://github.com/parse-community/ParseFacebookUtils-Android
152204
[parsetwitterutils-link]: https://github.com/parse-community/ParseTwitterUtils-Android
153205

0 commit comments

Comments
 (0)