I am new to ios programming,I want to sync data between mobile and app server, In android lot of ways are there to sync data similarly in ios I want to know different ways to sync data between mobile and app server, for every 12 hours I want to run sync service which takes care offline data storage.
            Asked
            
        
        
            Active
            
        
            Viewed 475 times
        
    0
            
            
        - 
                    1plz elaborate your question, post some code. – iUser Jun 27 '17 at 09:36
- 
                    every 12 hours i want sync data with server either push or pull from server,i didn't find any way in ios ,one thing i can do it with push notifications,schedule timer is there any other way – skyshine Jun 27 '17 at 09:38
- 
                    Maybe store the "next time to sync" as an NSDate using NSUserDefaults? https://developer.apple.com/documentation/foundation/nsuserdefaults?language=objc Check if that stored date has expired each time the app becomes active. If it hasn't fire a timer in case the update point happens while the app is in foreground. – leandrodemarco Jun 27 '17 at 09:56
1 Answers
0
            
            
        make a singleton class make a GET api call and update ur local data or database accordingly as per requirement.
 
    
    
        vaibby
        
- 1,255
- 1
- 9
- 23
- 
                    every 12 hours i want sync data with server either push or pull from server,i didn't find any way in ios ,one thing i can do it with push notifications,schedule timer is there any other way – skyshine Jun 27 '17 at 09:39
- 
                    what u can do is u can update ur data while u start ur app. also u can try to implement some services to achieve ur data syncing. read this. https://stackoverflow.com/questions/11044095/ios-keep-an-app-running-like-a-service – vaibby Jun 27 '17 at 09:55
