Comments (4)
From what I could see, I believe the params exist only to workaround problematic behaviour of GCM, and I can imagine a client side workaround in the SDK. But anyway, here we are, so the sooner we investigate/confirm that FCM behaves sanely, and the sooner we release updated Android SDK, the better... for the cleanup of SDK and Push Adapter.
Additionally I can imagine a fix where we can actually lift the push_id
and time
away from the push adapter and let it be passed as part of request data into Parse.Push.send
with parse server 8. That way people like me, who care about old Android installations that will not get updated ever... can still send compatible pushes... by adjusting their payload passed to Parse.Push.send
...
from parse-server.
Thanks for opening this issue!
- 🎉 We are excited about your ideas for improvement!
from parse-server.
Dropping this here as my initial investigation:
When a push is received in an Android app using official Parse Android SDK, the message is handled by the FirebaseMessagingService.onMessageReceived
method:
This method extracts push_id
, data
, time
, and channel
parameters.
channel
was/is used for channel based push targeting, where clients can subscribe to given list of channels and automatically receive all pushes targeted to that channel.
data
is JSON encoded everything and anything that you actually send via Parse.Push.send
from the server side.
push_id
, and time
are then passed over to PushRouter.handlePush
where they are double-checked to not be nil/empty.
- If
push_id
andtime
are empty, the push is thrown away. - If they are not empty, the push is stored into history, and then passed to Android
BroadcastReceiver
.
There is a comment atop of the PushRouter.java
file explaining that history is needed essentially because duplicate pushes could be actually received when the push was being sent by the GCM.
- For PPNS, we provide the last-seen timestamp to the server as part of the handshake. This is
- used as a cursor into the server-side inbox of recent pushes for this client. - For GCM, we use
- the history to deduplicate pushes when GCM decides to change the canonical registration id for a
- client (which can result in duplicate pushes while both the old and new registration id are still
- valid).
So in order to remove push_id
and time
parameters from the Parse Android SDK, we need to make sure that:
- FCM is never sending duplicate pushes to the same device.
- timestamp of last contact is not required by FirebaseMessagingService.
Once we verify these two are handled, we can simply drop them from the Parse Android SDK, along with the history, and start propagating updated SDK to the clients.
Later after some years we can remove them from the Parse Push Adapter
, once we are sure that there are no clients expecting them.
The risk is that clients in the wild using old Parse Android SDK will stop receiving pushes - will start dropping pushes because of lack of push_id
and time
.
from parse-server.
Thanks for the investigation.
Sending these params can be off by default already in the next Parse Server 8 release. We should just make sure to offer the corrected Android SDK at the point.
We would have to check wether other Parse repos use these params. A quick org-wide search for these params on GitHub shows occurrences in the following repos:
- Parse Android SDK
- Parse Flutter SDK
- Parse Dashboard
- Parse Server Push Adapter
- docs
from parse-server.
Related Issues (20)
- Postinstall script incorrectly parses required min. Node version HOT 4
- Upgrade to mime 4 HOT 1
- `Parse.User.loginAs` method not working HOT 2
- Email Verification Link Generates "Invalid Verification Link" Error When username is in protectedFields HOT 1
- Scoped Session Tokens HOT 4
- Null exception on instialize the parse client HOT 2
- Add support for async `FilesAdapter.getFileLocation` HOT 2
- Fix flaky test `ParseLiveQuery handle invalid websocket payload length` HOT 1
- Fix flaky test `rest query query internal field` HOT 1
- Fix flaky test `UserController sendVerificationEmail parseFrameURL not provided uses publicServerURL` HOT 1
- Fix flaky test `UserController sendVerificationEmail parseFrameURL provided uses parseFrameURL and includes the destination in the link parameter` HOT 1
- Fix flaky test `Email Verification Token Expiration: sets the _email_verify_token_expires_at and _email_verify_token fields after user SignUp` HOT 3
- `Parse.File` name support for languages with non-ASCII characters HOT 1
- Cannot find method onLiveQueryEvent in Parse.Cloud typescript HOT 1
- Parse.Files cannot be created if over 512MB HOT 2
- The `_hashed_password` field cannot be deleted from _User collection HOT 2
- Adding Elestio as deployment option HOT 1
- Parse.Schema save method has invalid return type HOT 1
- Cache idempotent requests responses HOT 4
- Let cloud code access user roles HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parse-server.