uniqush / uniqush-push

Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.

Home Page:http://uniqush.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delivery Success but not receiving on device.

lube opened this issue · comments

I subscribe correctly and the message gets delivered correctly in iOS, but not on android.

Any help?

[Push][Info] 2018/08/24 20:58:44 RequestID=5b807184-OMVeEChySKhLWxZZEg1UCA== Service=promogo Subscriber=lube PushServiceProvider=fcm:ee074643b5ae0c11ee93147348a181e40edaec81 DeliveryPoint=fcm:4c7dbcde37312b03c0fad825a2509642e9150cb7 MsgID=fcm:ee074643b5ae0c11ee93147348a181e40edaec81:0:1535144324485530%fd0791fdf9fd7ecd Success!

Note that on Android, you have to implement a push notification handler to actually render the push notification. (For historic reasons)

Have you implemented that handler? Is it receiving any events? Are you using the FCM SDK?

Does it work if you invoke the FCM push notification with the regid and the API keys for FCM?

If I curl, I receive the notification correctly:

curl -X POST \

-H "Authorization: key=..."
-H "Content-Type: application/json"
-d '{
"registration_ids": [
"eakUnJYJnM0:APA91bG2rSg_kjGqM74drhxgsbcPJIhPDzOqM7-kXcS9UTczd-dzWGr-pIg7hgF_Sw113DVuYOhOPqjH1MUS26NJJQ6oGU3Ig7w8RpFFcBnLXk7-8NZaPulv4gGkNkKJsg0MnsHUhnkw"
],
"data": {
"message": "Manual push notification from Lube"
},
"priority": "high"
}'
https://android.googleapis.com/gcm/send

If i use the regid to subscribe to a service and send a notification, I do not receive it, any idea what could be happening, or how to debug, besides the log file?

  1. You can use the /previewpush endpoint to check if the two payloads are the same
  2. We changed to the FCM endpoint for GCM pushes, but that shouldn't matter
  3. Can you post the services you have in /psps, redacting any API keys/secrets?

I just noticed a likely cause:

You seem to be pushing to an FCM service in uniqush, but pushing to the GCM service with curl. Uniqush with fcm may not work. (PushServiceProvider=fcm:e... is in that log file.

Instead, create a psp with pushservicetype=GCM and try pushing to that.


What uniqush params are you using? Are you using message= (msg= won't work)?

If you have designed the Android app in a way that expects "message", you may wish to use uniqush.payload.gcm/uniqush.payload.fcm. See http://uniqush.org/documentation/usage.html

I started reading my adb logcat and that was it, the field needs to be "message" to work both on android and ios.

Should I make a pull request updating that on the docs? Or was it a problem in my end?

It's a problem on your end, mostly.

"msg" becomes an APNs push notification "msg" and a GCM push notification's field "data": {"msg": ...}. GCM doesn't transform most of the fields.