-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add GCM client #227
Add GCM client #227
Conversation
5a0a4c4
to
d78b280
Compare
d78b280
to
164508c
Compare
8f03c5f
to
8e38a04
Compare
cc @fantasist for review |
'data': JSON.stringify(coreData) | ||
} | ||
var payload = { | ||
priority: 'high', |
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 shouldn't default to high on GCM
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.
Any reason besides the battery concern?
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's also not the current default for hosted Parse
Mostly LGTM. For the date, you get to define the parameters here right? It seems like expiration_date should just be a regular JS date or null. For priority, here was our plan for supporting GCM priorities in the API server:
If you do anything with priority here, I vote for either always sending with low priority (which we currently do in the API), or using the simple policy described in (3). |
8e38a04
to
a821a7b
Compare
@bnham , for the |
@wangmengyan95 updated the pull request. |
a821a7b
to
96da0cc
Compare
@wangmengyan95 updated the pull request. |
*/ | ||
var generateGCMPayload = function(coreData, pushId, timeStamp, expirationTime) { | ||
var payloadData = { | ||
'time': timeStamp.toString(), |
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 current API server sends an ISO8601-formatted date like "2016-02-05T13:08:00.000Z" here, not an integer. I think we should match that behavior.
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.
👍
96da0cc
to
0a9e382
Compare
@wangmengyan95 updated the pull request. |
0a9e382
to
354d328
Compare
@wangmengyan95 updated the pull request. |
354d328
to
872e690
Compare
@wangmengyan95 updated the pull request. |
Add GCM client for push notification. For the
expirationTime
, we use a fixed length string in go, do we need to follow this?