-
-
Notifications
You must be signed in to change notification settings - Fork 514
Update Android push docs, and app setup for 1.17.0 #522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@rogerhu Do you mind taking a look? |
| android:value="id:YOUR_SENDER_ID" />; | ||
| ```groovy | ||
| dependencies { | ||
| implementation 'com.parse:parse-android-fcm:latest.version.here' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's set to 1.17.0 so it's ready to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something that would replace the 1.17.0 with the later version when we do a new release? Otherwise, I think it is probably pretty annoying to have to edit these files all the time when there is a new release. Maybe just making this always say latest.version.here would be easier to maintain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use https://api.bintray.com/packages/parse/maven/com.parse:parse-android/images/download.svg for our badge version..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Trying to figure that out took 10 mins!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean we would include the badge below that line of text or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's always hard to figure out where to find the latest version is..
| ``` | ||
| Then, follow Google's docs for [setting up an Firebase app](https://firebase.google.com/docs/android/setup). Although the steps are different for setting up FCM with Parse, it is also a good idea to read over the [Firebase FCM Setup](https://firebase.google.com/docs/cloud-messaging/android/client). | ||
|
|
||
| Change the `android:name` attribute of `<category>` element above to match your application's package name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also should mention the migration from GCM to FCM link (https://developers.google.com/cloud-messaging/android/android-migrate-fcm)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could potentially mention it in the README for GCM, but not here, since hopefully most won't need to care about it.
| #### Configure Broadcast Receiver and Permissions | ||
| #### FCM Push Setup | ||
|
|
||
| Add the following service and broadcast receiver definitions to `AndroidManifest.xml` immediately before the *closing* `</application>` tag: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're also forgetting that we need to add the app to the Firebase console, download the google-services.json and applying the apply plugin: 'com.google.gms.google-services' statement too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is mentioned below, in the "Then, follow Google's docs for setting up an Firebase app" text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I found it confusing what to do given there are some steps that aren't necessary.
| .server("http://localhost:1337/parse/") | ||
| .build() | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we have to do ParseFCM.register(this); in the Application instance if we want push?
(Or ParseGCM.register(this)) for an older version..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it is not required for FCM. I think we will leave the GCM instructions out of here, only mentioning it at the bottom, so that people will move away from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was playing with it last night but couldnt get stuff to fire unless I did the register command with FCM...you sure it works without it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, I was putting a breakpoint on the wrong place. Works fine!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my updates about how a JobService is scheduled to run when the app starts:
https://github.com/parse-community/Parse-SDK-Android/pull/817/files

| <meta-data android:name="com.parse.push.gcm_sender_id" | ||
| android:value="id:YOUR_SENDER_ID_1,YOUR_SENDER_ID_2,YOUR_SENDER_ID_3" />; | ||
| ``` | ||
| The Parse library provides push notifications using Firebase Cloud Messaging (FCM) if Google Play Services are available. Learn more about Google Play Services [here](https://firebase.google.com/docs/cloud-messaging/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this section should include the fact that calling ParseFCM.register(this) automatically passes the Installation object to the Parse server as a GCM token type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user should never have to call this manually given our setup. Do you think we should still mention that it is happening?
|
I think this should be good to go, other than the |
|
We still need the bintray plugin to automate builds to jcenter...I.e.
./gradlew bintrayUpload
…On Wed, May 2, 2018, 8:51 AM John Carlson ***@***.***> wrote:
I think this should be good to go, other than the latest.version.here
bit, if we want it to have a badge that show the latest version. I have a
PR to test this out in the main repo parse-community/Parse-SDK-Android#815
<parse-community/Parse-SDK-Android#815>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#522 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAT8yRNdVhE33lawNVTYno_y6-k6cvieks5tudYXgaJpZM4Tu5b4>
.
|
| super.onCreate(); | ||
| Parse.initialize(new Parse.Configuration.Builder(this) | ||
| .applicationId("YOUR_APP_ID") | ||
| .clientKey("YOUR_CLIENT_KEY") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Client key can be null, as it is by default
| ```groovy | ||
| dependencies { | ||
| implementation 'com.parse:parse-android:1.16.7' | ||
| implementation 'com.parse:parse-android:latest.version.here' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should put a comment about adding the FCM package here as optional
implementation 'com.parse:parse-fcm-android:latest.version.here'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe we should have a note about push somewhere in the README, but there are plenty of people/apps that use Parse Android without using any form of push, so I think it might be confusing here.
|
I'm pushing and tagging 1.17.0 the Android SDK right now...can you help tweak up these changes so we can have it ready? Thanks! |
For 1.17.0, the way you setup push changes for using FCM instead of GCM.
This also removes references to setting up the app in the Android Manifest in favor of setting it up in the Application class, using the builder.