Skip to content

Upgrading GCM to v4 #1369

Closed
Closed

Description

@inlined

Aside: This request may only have implications on the Android SDK; I'm bringing it up here because it's mostly focused around helping people with the Parse Server migration.

Hey everyone. When the Parse sunsetting announcement came out, I wanted to help my old customers out. I’ve chatted offline with a few push providers like Batch and OneSignal to help with their migration process. I also chatted with the the GCM team to see if there was anything Google could do to help Parse customers. It looks like the best answer is “upgrade”.

When we (@bnham and I) did the GCM integration for Parse Push, GCM was on v3. V4 has a lot of new features; the most important for Parse customers is topics. Parse customers can register a ParseInstallation’s channels as a topic and keep their targeting info for push-to-channel no matter which GCM push provider they use[1]. Push to topic is also much faster than Parse Push’s normal engine--a “mega” push, if you will.

To enable topics, Parse’s Android SDK will need to start requesting tokens using the v4 Instance ID APIs. The only catch I can think of is that v4 changed the way sender IDs worked. V3 returned one token that worked with multiple sender IDs; the v4 APIs will return one token per sender ID. Since ParseInstallation.deviceToken is a scalar, the Parse SDK would need to request a token for the Parse sender ID or the developer-provided ID.

Hope this helps. If you decided to upgrade to v4, I can get the Intent lifecycle from the GCM team. This will help you upgrade while still avoiding the compile-time dependency on the GMS SDK.

[1] If it interests you, GCM v4 also introduced support for APNs. You could get the same benefits for Apple devices if you added the GCM SDK, though I understand if you want to stay with the native API.

Activity

  1. flovilmart commented on Apr 5, 2016

    @flovilmart
    Contributor

    @inlined thanks for the heads up! We moved the push implementation to https://github.com/parse-modules/parse-server-push-adapter, I'll give you full access to the repo so you can get going with the implementation.

  2. inlined commented on Apr 5, 2016

    @inlined
    Author

    Awesome. The first steps are in the android client SDK. If you think this is the right direction we can get started there.

  3. flovilmart commented on Apr 5, 2016

    @flovilmart
    Contributor

    I'm all for it, we'd need to revamp a bit the PushController to let the adapter handle the channels in that case, but that's a minor tweak

  4. flovilmart commented on Apr 5, 2016

    @flovilmart
    Contributor

    On that note, the current parse-server-push-adapter don't support sending to iOS device using GCM, even if GCM supports it. We could imagine:

    parse-server-gcm-push that provide push for all supported platforms by GCM
    and rely on this adapter on parse-server-push-adapter to send to android.

    It would be nice if we could choose the API level (3 or 4) from the config.

    What do you think?

  5. inlined commented on Apr 7, 2016

    @inlined
    Author

    I was assuming that all tokens would be refreshed as GCM v4. Is there a
    benefit to staying on 3? GCM is implemented in Google mobile services, not
    the core OS, so there shouldn't be any device restrictions imposed by the
    version bump.
    On Apr 5, 2016 6:49 PM, "Florent Vilmart" notifications@github.com wrote:

    On that note, the current parse-server-push-adapter don't support sending
    to iOS device using GCM, even if GCM supports it. We could imagine:

    parse-server-gcm-push that provide push for all supported platforms by GCM
    and rely on this adapter on parse-server-push-adapter to send to android.

    It would be nice if we could choose the API level (3 or 4) from the
    config.

    What do you think?

    —
    You are receiving this because you were mentioned.
    Reply to this email directly or view it on GitHub
    #1369 (comment)

  6. flovilmart commented on Apr 7, 2016

    @flovilmart
    Contributor

    for the time client transitions from v3 tokens to v4? I'm not familiar with GCM at all, so those questions may be completely dumb :)

  7. inlined commented on Apr 26, 2016

    @inlined
    Author

    Sorry for the delay; my day job cropped up. The same RESTful endpoints will accept v3 and v4 tokens, so there doesn't seem to be a need for any client-side configuration.

  8. stale commented on Sep 18, 2018

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  9. added
    type:featureNew feature or improvement of existing feature
    and removed on Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions