What are some ways I can sync iPhone Game data between multiple devices? - iphone

From the Getting Started with Game Center doc
A player might have the same Game Center enabled game loaded on multiple devices. If your
app has reported progress on an achievement from one device, note that the same
achievement progress data will be provided by Game Center on other devices where the user
plays your game. However, other game state maintained by your app may not be in sync and
should be handled accordingly.
I'm relatively new to iOS development and about to begin researching how to sync local game state data (i.e. which levels the player has completed, which levels the player is currently on, etc.) between the different hardware (iPhone, iTouch, and iPad) running my game and I was hoping I could get some insight from the SO users on some good ways to do this. Do I need to build a web service for this? Can iTunes be used to sync this data? Is there an API specifically built for this?
Thanks for your wisdom!

I think using a web serivice and making a JSON post and request would be a good route.

One suggested method by Apple is to use the Application Preferences, which is backed up by iTunes when the user syncs the phone.

I use NSUserDefaults for this and and it works great!

iCloud is your ticket

Related

How to share data between multiple devices within a universal App to keep Apps in sync?

I've made an application which supports game center. A user can play a certain amount of levels and can achieve a score for each level. The score is being kept by using Arrays filled with dictionaries with info of the score of each round.
Because this game is using game center I would realy like to keep my games in sync if a user uses multiple devices to play on with the same game center ID. How can I achieve this to have a real time 'game updater' to share the score of each level between multiple devices?
Does game center brings such functionality? Is there a way to push data trough iCloud? or should I consider using a backend server which saves and loads the scores for each level and for each user?
Follow up of tkanzakic his answer:
I found this helper class for synching all my NSUserdefaults data link
I haven't play with Game Center so I don't know if you can share information between multiples devices, but with iCloud for sure that you can. If you store this information in the user's defaults it will be automatically shared trough this services, check this http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/UserDefaults/StoringPreferenceDatainiCloud/StoringPreferenceDatainiCloud.html

Game Center Mutliplayer

If I'd want to implement multiplayer checkers game using game center API, does it mean that I don't have to write a server, and I'll be using game center's servers?
I'm new to game center, and I'd like to know its use.
Thanks.
Here is a great tutorial that will get you up and running in a couple of hours!
Beginning Turn Based Gaming with iOS5
Yes, Obsolutely you don't want to write any servers. The apple's Game Center handles it. First of all you need to import GameKit framework. It will maintain game center servers.In Game Center you have Leaderboards (Where you can see the scores of all players who are using your app), and Achievements (You can setup some achievements that when a user crosses particular scores 1000, 2000, 3000.. etc. in your app). The Leaderboards and achievements are two different viewControllers you can show them through coding. For More Details You can visit the following link http://developer.apple.com/library/ios/#DOCUMENTATION/NetworkingInternet/Conceptual/GameKit_Guide/GameCenterOverview/GameCenterOverview.html it is very clear. And if you have any doubts feel free to contact me. I have implemented Leaderboards and achievements recently, but not multiplayer features. And to perform all these you have to enable GameCenter in your iTunes account.
As matter of fact in order to have a good multiplayer game experience, you need to consider eventually writing server side code that saves the user data in your database.
I have experienced the same scenario and ended it up using Parse along with push notifications.
If you insist you can do the following with Game Center :
With Game Center services you can connect players to each others either by Real-Time Matches or Turn-Based Matches. Everything is fine as long as you don't care about the user data storage or the game experience!

How to Find Nearby iOS Devices (GPS locations) using same app

I want to create an app that allows a user to find the nearby other users location using GPS coordinates who are Logged in to the same app .Also it can be track the location of the devices(Logged in to the same app) which are moving in a car .
Can someone give me an overview of how I can accomplish this. is there any free API available to accomplish this task.
Danielbeard is correct - you would need to be continually storing/updating locations on a server somewhere. Your app does get some running time when it is in the background, but I'm not sure it would be enough to run the web traffic that you'd need.
Check out this post: Running app in background and send frequent http request
And check out the multitasking guide here: Multitasking Guidelines
You can also look at Push Notifications. Hopefully this helps.
In iOS7 MultiPeerConnectivity was introduced to find near by applications, so if you have a coffee shop and someone walks by or in they could get the latest deals, or, you walk into a room and the music changes to what you like as your device exchanges information with another.
http://nshipster.com/multipeer-connectivity/

OpenFeint, Game Center and multiple users

I'm about to add highscore support to my mobile game and I have a basic understanding problem with leaderboard services like OpenFeint or Apples Game Center:
Suppose I'm logged in to OpenFeint and/or Game Center with my account. Then a pal of mine wants to play, I hand him my device and he gets the best score ever. Is there any way he can get his score listed under his name now? My understanding is that he can't, because when the game is over the score is saved, and it is automatically saved for the current account, which happens to be mine at that moment. Tough luck.
This would mean that if I play the game with my pal in turns we would constantly have to log in and out from both services after each game to get it right in the case that one of us gets a highscore. That seems a bit awkward...
Do I overlook something or is this just the way it works? Or do I have to take care for this situation as a developer? Or do the OpenFeint/GameKit SDKs handle this automatically somehow?
I don't know about Open Feint, but at least for Game Center I think the answer to your question is: Yes, that's just the way it works. Even if you know the Game Center id's for both you and your friend, you don't have the ability to save stats for anyone but the logged in game center player.
It does seems possible that they could have supported this use case, to allow more than one player to be "signed in" on a given device, and then the game could just present a "PlayerA", "PlayerB" button to choose who's playing, instead of having to run the Game Center app to do the switch. But I imagine this use case wasn't a super high priority. (They'd rather have each of you playing on your own devices. And in fact some services like ScoreLoop keep things simple by enforcing a single player per device, period.)

How to test location based iPhone application during development?

I am currently developing a location based iPhone application. Is there any way to test the app other than taking the iPhone to different places?
Thanks
Yes, you can.
Try this: http://www.vimov.com/isimulate/
(...) With iSimulate installed on their iPhones however, their multi-touches on the iPhone (which gets interpolated for the larger iPad screen), the movement recorded by the accelerometer, the location and orientation captured by the GPS and Compass, all get wirelessly sent to the iPad Simulator, so they can develop virtually any application they want, before the iPad is itself released!
Even though an answer have long been accepted for this question I'll still chime in with some additional information on the topic.
The kind folks at FutureTap have mad the FTLocationSimulator available for free at GitHub. It allows you to prepare a test route using for instance Google Earth, and then have the simulator feed these coordinates to your app.
I've written a blog post about how to use FTLocationSimulator to easily switch between multiple routes during testing of the location features.