Do Not Receive Receipt_notification Postback from GCM CCS

I am trying to get receipt from CCS, but I just can't.

That's what I'm doing:

I have a go script:

 package main import ( "fmt" "github.com/brunohenrique/go-gcm/ccs" ) var ( user = struct { gcmToken string }{"mg0xe56LfjE:APA91bFHtHVQt85iNgyzTeDowovIGPAD_NbBjURppy1LgV9_oaM2R_9zn1fDXNuEeOoALTj7F8e8JmNPI3Md-CbbgTxdvxVrONFVfGz2dOujsaGkZjEhJcBH8sWvRNYZNIp2j2QliAEX"} ) func main() { con := connect() // Sends a message con.Send(&ccs.OutMsg{ To: user.gcmToken, ID: "m-1366082849205", Notification: map[string]interface{}{ "title": "Hey!", "body": "There", "sound": "default", }, TimeToLive: 600, DeliveryReceiptRequested: true, DelayWhileIdle: true, }) // Listen to messages for { m, err := con.Receive() if err != nil { fmt.Printf(">>> Err: %+v \n", err) } go func(m *ccs.InMsg) { fmt.Printf(">>> InMsg: %+v \n", m) }(m) } } 

Everything looks good when I run the script, but does not receive a receive message:

enter image description here

And here is what I do when I get a notification:

enter image description here

Am I doing something wrong or is something missing?

+7
ios go google-cloud-messaging
source share
2 answers

Thanks for polling GCM on iOS. Unfortunately, delivery receipts are not available for displaying notifications on iOS at the moment.

+1
source share

Not sure if you are trying to use this on Android or iOS, as it works for me on Android, but it does not always work on iOS.

Delivery receipts for iOS do not work with the notification parameter in the request. I managed to get it to work for a simple data message, i.e. with a payload

 { "to" : <reg id>, "data" : { "hello" : "world", "id" : 123 } } 

But if I added a notification payload to the previous one, this did not work.

I would suggest that since a notification payload should be sent via APNS, they don’t know if the message was sent or not, since APNS does not return any result.

For the no notification message, since it was received only when the application is in the foreground, they will be able to check whether the message was sent or not.

0
source share

All Articles