1

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?

mgamer
  • 13,580
  • 25
  • 87
  • 145

1 Answers1

1

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 AFHTTPClient.

Just remember to link and import the SystemConfiguration framework, otherwise it won't work.

Community
  • 1
  • 1
Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235