Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send NSData back and forth between devices - GameCenter alternative

I am trying to build an application that will require sending data between two devices over the internet. Sort of like GameKit, but I would like to implement the function without GameKit as I want to be able to exchange between different types of smart phones. I want it to be like a real-time match in GameCenter.

in GameKit I would be using the following:

//To send the data
- (BOOL)sendDataToAllPlayers:(NSData *)data withDataMode:(GKMatchSendDataMode)mode error:(NSError **)error;

//To receive the data
- (void)match:(GKMatch *)theMatch didReceiveData:(NSData *)data fromPlayer:(NSString *)playerID;

Is there a way to accomplish this same implementation without GameKit? I know the game Fun Run does real-time matches without GameCenter.

Any reply is greatly appreciated! Thanks in advance for your help!

like image 463
jacob Avatar asked Dec 22 '25 16:12

jacob


1 Answers

Well, it's trivial with dedicated server with whom both devices open a persistent connection and probably impossible without it (how do your devices find each other if both of their IP addresses change?)

like image 52
ilya n. Avatar answered Dec 24 '25 08:12

ilya n.