Uniqush slow notifications issue on iOS

58 views
Skip to first unread message

Ankit Thanekar

unread,
Jun 2, 2017, 5:44:53 AM6/2/17
to uniqush
Hi I've been using uniqush for a while now and it was working very good but recently when i try to push a message the notifications come with a delay of around 10 mins. I get all the success messages in logs. Some times the connection gets closed and User gets unsubscribed automatically. So what can be the problem ? Also do we have to change anything in config file to use uniqush with AWS ?

Tyson

unread,
Jun 2, 2017, 3:39:47 PM6/2/17
to uniqush
Are you talking about GCM or APNS? You didn't mention which, but it sounds like APNS.

Connection disconnect happens when a push token is invalid (e.g. user unsubscribes, sandbox token is accidentally used for prod apns server, token used for wrong app's certificate, etc.)

Try passing ttl=0 (or some small value like 10) along with the other query parameters in the API call to push: http://uniqush.org/documentation/usage.html#push-message (But even after doing that, #152 might need to be fixed first)

By default, APNS is given a TTL of an hour, so the APNS servers are free to postpone the messages

https://github.com/uniqush/uniqush-push/issues/152
https://github.com/uniqush/uniqush-push/issues/151

I'm using a patched version of the latest uniqush-push for one project, where the below line is among the changes:

srv/apns/push_service.go
246:    expiry := unixNow + 60*60  // Change this to `expiry := 0` to default to attempting to send immediately



A UNIX epoch date expressed in seconds (UTC) that identifies when the 
notification is no longer valid and can be discarded.
If this value is non-zero, APNs stores the notification tries to deliver
the notification at least once. Specify zero to indicate that the 
notification expires immediately and that APNs should not store the 
notification at all.

Ankit Thanekar

unread,
Jun 9, 2017, 2:39:14 AM6/9/17
to uniqush
Hi ,
Thanks for the quick reply sorry I had some urgent issue to attend to, so couldn't reply fast. Yes I'm using APNS, I have added ttl in every call now as 0. Can you explain why this is happening suddenly as it wasn't happening before.

Tyson

unread,
Jun 9, 2017, 2:38:30 PM6/9/17
to uniqush
I couldn't find anything about why it changed. Maybe APNS was just having delays that day, or your device was saving battery.

- I assume a low TTL or 0 forces APNS to immediately attempt sending it(but didn't see documentation of what it does, exactly). Also, the master branch of uniqush has updated support for TTL=0 and V2 of the APNS binary protocol.

If you set the TTL to a larger value today, do you still have that problem?

https://stackoverflow.com/questions/32866191/push-notifications-take-too-long-to-arrive/32874633#32874633 may help, haven't looked at the answer in much detail.

Tyson

unread,
Jun 9, 2017, 2:41:32 PM6/9/17
to uniqush
From your response, it isn't clear if your problem persists or is still happening.

If it's still happening, try again by downloading the master branch of https://github.com/uniqush/uniqush-push , fetching new dependencies, and compiling that, and deploying the new binary

Ankit Thanekar

unread,
Jun 9, 2017, 3:15:48 PM6/9/17
to uniqush
Yes the problem still persists, Okay I'll install the new binary and will let you know the results. 

Ankit Thanekar

unread,
Jun 12, 2017, 3:24:48 PM6/12/17
to uniqush
Hey ,
We deployed the new changes , still the problem persists. We tried it on 2 servers , same thing is happening. We'll be switching to FCM now I guess. Thanks for your help !
Reply all
Reply to author
Forward
0 new messages