Possible to be subscribe to multiple channels
klaaspieter opened this issue · 3 comments
klaaspieter commented
The unsubscribe logic doesn't handle failure. If unsubscribing fails that device will not likely ever be unsubscribed. This means that device will continue receiving push notification for a previous time zone.
A potential fix, that doesn't require complicated retry logic, is to keep a list of time zones to unsubscribe from in NSUserDefaults
and on every app launch attempt to unsubscribe again.
klaaspieter commented
I'm also wondering if there is a RAC solution to the retry problem? @sharplet?
sharplet commented
The short answer is yes, RAC does have good support for retry logic. The basics:
- Objective-C:
- Swift:
retry(_:)
- Or the more general
flatMapError(_:)
I've used retry
and catch
in the past to implement an exponential backoff strategy.