Hi,

In my application I have a small registration form. I want the functionality to work like following

  • If the device is connected to network, data should be stored directly in server.
  • If device is not connected to network, then it should store temporarily in device and when the device connects to network it has to store the data in online server.

Please tell if this is possible and what is the right method to do it.

Thanks.

有帮助吗?

解决方案

  • Yes, it's possible
  • You can store whatever state you want locally and use one of the Reachability classes to see if a network connection is available and then attempt to run your network code to upload this state to the server.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top