Network game: how to handle turn game (like ruzzle management) - ios

I am wondering how to handle matches like do ruzzle in ios:
I have read Game Kit Programming Guide and seems not what i am searching for.
in ruzzle one player can play the game and the other can play it too, while all two player haven't finished, i can't go to the second.
GKTurnBasedMatch can't be because only one player at a time can make his move.
Real-Time Matches? but if a player accept to play, then disconnects, the forst player can finish and wait the answer of the opponent, while seems not be so in real-time matches
should i have a separate server that stores the game, or i can use some other apple API?
thanks

Related

Can Game Center Track total time played?

Curious to know if Game Center tracks total time played per app? If it does, how could I easily query this data?
Thanks!
No, you cannot use game center to do this. There are a couple of options though.
You can track it locally, and then upload the data to a game center leaderboard. I don't know if you want to do that though because then everyone can see how much a certain player has played
You can use some sort of analytics service, like Google Analytics and ping it periodically while a player is on the app so you can see how much people are playing
Or you can set up a server and database, where the player sends their play time when they are on the app

Is it possible to issue an alert when a GameKit opponent is ready?

I made a game using GameKit and I am using the framework to manage a real-time match between two opponents. If I invite a specific person to a match, or make sure they are "waiting for opponent" at the same time as me, the match and game goes smoothly and everything is great.
The problem I have now is that there aren't a lot of people on my app yet, and so people that are wanting to play against a random opponent who also wants to play, don't have any way of knowing when a match could be ready.
Is there a way to utilize GameKit, but enhance the experience so that a push notification or alert of some kind is sent when an opponent is found? It could be this is all built in, but I'm not seeing anything.
AFAIK, GameKit does not support push-notifications for matching real-time games while your App isn't running.
But, GameKit has a Player Activity API that tells you how many matches were requested in the last 60 seconds, and you could use that number to create an informative message or status to show the player.
EDIT: the methods in question are
- queryActivityWithCompletionHandler:
- queryPlayerGroupActivity:withCompletionHandler:

CloudKit and GameCenter in a game?

I am working on a game. It will use Game Center for multiplayer. I would like to be able to use CloudKit for storing levels and the local CloudKit container for storing game progress. The problem is that this requires to different accounts. Any ideas on how to link them together?
I struggled with this recently when building in syncing to my game Qiktionary. At first I associated single player game data with the currently logged in Game Center player. So when I started working on sync, I was associating the single player game data in CloudKit with the Game Center player by using a separate CKRecordZone (in the private db) for each Game Center player.
I ended up abandoning that approach because it turns out that causes some behaviour that looks to the user like data loss. For example, GC Player A is logged into your game and plays 10 single player games (or in your case, levels). Later they happen to log out of Game Center, and even later than that they come back to your game and since they are logged out, they no longer see their 10 games played. It's not obvious that the game data is there but just "missing" because they are now logged out of GC.
I did some research and most other games don't work like that. Single player game progress is not linked to the logged in Game Center player. Which means that the single player game data in CloudKit shouldn't be linked to the Game Center player either.
This is even how the GKSavedGame API from GameKit works. According to the docs:
Saved games are tied to the iCloud account, not the Game Center account

iOS: developing audio (music) streaming from server

I'm researching to start developing an audio streaming apps. First thing I'd like to ask is the framework to use for it. I've tested DOUAudioStreamer , tumtumtum/StreamingKit , RadioKit and etc.
The framework needs to be able to seek a song from certain seconds with low latency. Spotify has that amazing seek feature i.e. find a song you've never listened before and play it, then slide the time slider to the middle, the song continues to play with low latency as if it has downloaded the whole song before.
I guess you could do some predictive analysis as to what songs the user will listen to next, i.e. start caching songs before they actually start to play. That will at least improve the experience somewhat.

Game Kit Send data to offline player

I am pretty sure i know the answer but is it possible to send data using game kit to a player who is not playing the game anymore so next time he loads the game the data will be there. Is there any sort of messaging queue in gamecenter that can hold data
Nope, this is not possible if you let Game Center host the game. But you can set up your own server which stores the data and hands it over to the client while still having Game Centers match making functionality.

Resources