parse-server-push-adapter icon indicating copy to clipboard operation
parse-server-push-adapter copied to clipboard

Add token response interface

Open mtrezza opened this issue 1 year ago • 2 comments

New Feature / Enhancement Checklist

Current Limitation

Parse Server has the capability to remove invalid device push tokens from the _Installation class. The logic that parses the errors is in Parse Server and is applied to the push token response that is sent from the push adapter to Parse Server. That logic probably should be in the push adapter, since these errors are push API specific.

Feature / Enhancement Description

An interface that returns an array of "tokens to remove", "tokens with successful push", etc, to decouple the push adapter more from Parse Server.

mtrezza avatar May 09 '24 01:05 mtrezza

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

Like this idea, especially since Apple in particular can start to block you if you keep sending to bad devices.

if I could suggest a maybe(?) simpler solution is to just add a new property to the result object so that if result.transmitted === false StatusHandler just looks for result.deviceShouldBeRemoved === true. If that is set, remove the token similar to current error parsing logic.

mortenmo avatar May 12 '24 20:05 mortenmo