IOS – best way to queue requests to be sent when connection is reestablished
in my IOS application I have an in-app purchase in my app and I need to send receipt to my web service to assign premium content to a user account. I need this to be reliable even when the connection is lost right after the in-app purchase completes.
Are there any solid libraries out there that can take a request and execute it when connection is reestablished?
Solutions Collect From Internet About “IOS – best way to queue requests to be sent when connection is reestablished”
I would definitely recommend AFNetworking, a very well-made networking library which wraps NSURLConnection.
In order to use it for your purpose you need to take advantage of the reachability build-in features of
AFHTTPClient as suggested in this other answer.
Basically you can execute and arbitrary block whenever the reachability status of the network changes using the
setReachabilityStatusChangeBlock: method of
Just remember to link and import the
SystemConfiguration framework, otherwise it won’t work.
- Use of OR operator on Cloudkit predicate
- Xcode 9 Bug: Cannot find cdtool
- AVCaptureDevice – iphone/ipad as video source
- UITableViewHeaderFooterView subclass with auto layout and section reloading won't work well together
- UINavigation pushing a new root controller
- apple push notification limitation
- NSString to CFStringRef and CFStringRef to NSString in ARC?
- Swift 2.1 – Unexpectedly found nil while unwrapping an Optional on delegate method call
- How can I Quick Look custom objects with Xcode 5 visual debugger?
- Preloading textures in SpriteKit
- UITextView in UITableViewCell sizeToFit not working as expected
- New Firebase: Changing Database URL dynamically
- Will iOS region monitoring call didEnterRegion on my app if my app is in a terminated state?
- Getting OSStatus error 100021 when trying to ad hoc distribute ios app
- Convert HTML to NSAttributedString in iOS