soygul / gcm Goto Github PK
View Code? Open in Web Editor NEWGCM (Google Cloud Messaging) - CCS (XMPP Cloud Connection Server) and HTTP implementation.
License: MIT License
GCM (Google Cloud Messaging) - CCS (XMPP Cloud Connection Server) and HTTP implementation.
License: MIT License
if err := datastore.Get(c, key, record); err != nil {
We don't want to maintain an XMPP lib and GCM implementation ourselves so it's better to use something else (plain HTTPS with batching even).
"message_type":"receipt"
as described here: https://developer.android.com/google/gcm/ccs.html#receipts
Hi,
Thanks for this great library.
I have issue, that sometimes i receive delivery status from device, and sometimes not. My request is:
fcmMsg := &ccs.OutMsg{
To: deviceID,
Priority: "high",
DeliveryReceiptRequested: true,
DelayWhileIdle: true,
Data: data,
}
data is map[string]string.
Any known issue about this?
When we get following in response to a message with broken stanza (as described here: https://developer.android.com/google/gcm/ccs.html#stanza):
<message id="3" type="error" to="[email protected]/ABC">
<gcm xmlns="google:mobile:data">
{"random": "text"}
</gcm>
<error code="400" type="modify">
<bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
InvalidJson: JSON_PARSING_ERROR : Missing Required Field: message_id\n
</text>
</error>
</message>
The resulting output is:
&{XMLName:{Space:jabber:client Local:message} From: ID: To:[email protected]/... Type:error Subject: Body: Thread: Other:[ ]}
We should instead get our broken request:
<gcm xmlns="google:mobile:data">
{"random": "text"}
</gcm>
and the error details back in Other:[]
array.
Use error types specific to a given error along with extra info fields (maybe not? and simply favor simplicity). Either way, return type should always be error
in method signature as advised in Effective Go.
dequeue tip: "message_type":"receipt" as described here: https://developer.android.com/google/gcm/ccs.html#receipts
map[string]string
(https://github.com/soygul/gcm/blob/master/ccs/message.go#L26) seems to assume that Data is flat - to support a nested structure, it seems it must be map[string]interface{}
(as Google's implementation at https://godoc.org/github.com/google/go-gcm#Data is)
or just return errors.New("connection closed")
not handling them at all is also an option (as in tls.Conn
function which never account for closed connection)
I am trying to send message from the device to the server with no luck. I use the sample code with the Receive function.
As per Go testing docs (http://golang.org/pkg/testing/#hdr-Examples), test functions are compiled but not executed if they do not have concluding line that begins with Output: ....
statement. We should add that to our main example file ccs/example_test.go.
Hi,
Currently, the message ID is generated when the message is sent, and we have no way of getting it before it gets across the wire.
I want to track my message delivery status and need a way to match an ACK to a sent message. Storing the message ID when it is crafted would allow me to do just that.
I can develop it myself and make a PR if necessary.
Regards,
We can use sequential numbers optionally, just as the Android client does (1, 2, 3..) in upstream messages.
Cluster ID (process ID) can be prefix like: a1, b1, a2...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.