Use a non-zero default expiration time in SimpleApnsPushNotification #593
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in #566, defaulting to immediate expiration for push notifications may not be the best idea, and may contribute to lower-than-expected success rates for callers who don't specify an expiration timestamp. At the same time, we don't want to totally change the behavioral contract of the
ApnsPushNotification
in the interest of preserving backward compatibility.As a compromise, this pull request changes the behavior of the "use default expiration time" constructor in
SimpleApnsPushNotification
. Instead of passing anull
expiration time (which still means "expire immediately"), the default constructor will create a push notification that expires in 24 hours.I am, of course, open to feedback on both the approach and default expiration period.
This closes #566.