문제

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