Skip to content
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

Any way to get bad/invalid device tokens? #109

Closed
justinlu opened this issue Jul 20, 2016 · 6 comments · Fixed by #213
Closed

Any way to get bad/invalid device tokens? #109

justinlu opened this issue Jul 20, 2016 · 6 comments · Fixed by #213

Comments

@justinlu
Copy link

The APNS HTTP/2 will report bad/invalid device tokens. I think we should removed those invalid tokens from DB to prevent from sending them again and again.

Is there a way to get those from gorush API?

Thanks

@chekalsky
Copy link

Same question about GCM. Maybe add a callback to reporting about bad tokens?

@codepushr
Copy link

APNS has (had?) a feedback channel and GCM already sends the invalid tokens directly back in the response - one has to check the NotRegistered error in the result.

@andreyser
Copy link

To get APNS bad tokens I made a pull request - #175

@gebv
Copy link

gebv commented Mar 30, 2017

Can be a callback method via post custom method?

notify_of_error=http://172.16.0.23/listener_errors

Or via amqp\nsq or ws?

@appleboy
Copy link
Owner

appleboy commented Apr 7, 2017

I will implement the sync mode so you can get error message from fail push notification in API response.

cc @MrChenhao

@appleboy
Copy link
Owner

Release v1.8.1 https://github.com/appleboy/gorush/releases/tag/v1.8.1

If you need error logs from sending fail notifications, please set sync as true on yaml config.

core:
  port: "8088" # ignore this port number if auto_tls is enabled (listen 443).
  worker_num: 0 # default worker number is runtime.NumCPU()
  queue_num: 0 # default queue number is 8192
  max_notification: 100
- sync: false 
+ sync: true

See the following error format.

{
  "counts": 60,
  "logs": [
    {
      "type": "failed-push",
      "platform": "android",
      "token": "*******",
      "message": "Hello World Android!",
      "error": "InvalidRegistration"
    },
    {
      "type": "failed-push",
      "platform": "ios",
      "token": "*****",
      "message": "Hello World iOS1111!",
      "error": "Post https://api.push.apple.com/3/device/bbbbb: remote error: tls: revoked certificate"
    },
    {
      "type": "failed-push",
      "platform": "ios",
      "token": "*******",
      "message": "Hello World iOS222!",
      "error": "Post https://api.push.apple.com/3/device/token_b: remote error: tls: revoked certificate"
    }
  ],
  "success": "ok"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants