Push API: Fix unsubscribing from GCM on Android
We were calling Android GCM's unregister API, which clears all of an app's subscriptions (all sender ids and subtypes). Since from Android's point of view, the app is Chrome, if any webapp unsubscribed from push messaging, all webapps would be unsubscribed! Instead now we call the unsubscribe API, which only unsubscribes a specific (sender_id,subtype) pair (where the subtype corresponds to GCMDriver's app_id). So now if a Service Worker calls pushSubscription.unsubscribe(), it'll only unsubscribe that SW's push subscription. In order for this to work, we now also call the corresponding subscribe API (accepting a single sender_id) instead of register. GoogleCloudMessagingV2.java is still temporary code, that will be removed once we switch to the Google Play Services client library. BUG=457374 Review URL: https://codereview.chromium.org/914693002 Cr-Commit-Position: refs/heads/master@{#317062}
Showing
This diff is collapsed.
Please register or sign in to comment