Search Results

Search found 45 results on 2 pages for 'gamekit'.

Page 2/2 | < Previous Page | 1 2 

  • iOS Development: Should the "playersToInvite" property contain an array of strings or an array of GKPlayer objects?

    - by BeachRunnerJoe
    Should the playersToInvite property of the GKMatchRequest object contain an array of NSString objects that hold the player id's or should it contain an array of GKPlayer objects? The documentation on this critical property is not clear at all and I've tried both ways, but my code isn't working, so I can't tell by experimentation. Here's the description for that property in the docs... A list of players to invite to the match. Why did they even bother writing that? Thanks for your help!

    Read the article

  • GKSession sendDataToAllPeers getting invalid parameter

    - by cb4
    This is my first post and I wanted to start it by thanking the many stackoverflow contributors who will never know how much they helped me out these past several days as I worked to complete my first iOS app. I am indebted to them and to this site for giving them a place to post. To 'pay off' some of that debt, I hope this will help others as I have been helped... So, my app uses the GKPeerPickerController to make a connection to a 2nd device. Once connected, the devices can send text messages to each other. The receiving peer has the message displayed in a UIAlertView. Everything was working fine. Then I decided to experiment with locations and added code to get the current location. I convert it into latitude & longitude in degrees, minutes, and seconds and put them into one NSString. I added a button to my storyboard called 'Send Location' which, when tapped, sends the location to the connected peer. This is where I ran into the problem. Both the send text and send location methods call the sendPacket method with a NSString. sendPacket converts the string to NSData and calls sendDataToAllPeers. When I learned how to capture the error, it was "Invalid parameter for - sendDataToAllPeers:withDataMode:error:". [.....pause.....] Well, this was going to be a question but in writing all this to explain the problem, the answer just dawned on me. Did a few tests and verified it now works. The issue was not in sendDataToAllPeers, it was in the conversion of the NSString (strToSend) to NSData: packet = [strToSend dataUsingEncoding:NSASCIIStringEncoding]; Specifically, it was the degree sign character (little circle, ASCII 176). NSASCIIStringEncoding only includes ASCII characters up to 127 so don't use any above that. I'm sure there was a quicker way to find the problem, but I don't know Objective-C or Xcode's debugging facility well enough yet. Whew! Several hours to discover that little tidbit. I did learn a lot, though, and that's always a good thing!

    Read the article

  • Tell Xcode to ignore a header for some targets?

    - by William Jockusch
    I have an Xcode project with a mac target and an iOS target. The project contains a class IPhoneOnlyClass which is used in the iOS target only. I have unchecked IPhoneOnlyClass.m from the mac target so it doesn't compile that file. Now IphoneOnlyClass.h contains the line #import <GameKit/GameKit.h> When I am compiling for the mac target, Xcode gives me an error: error: GameKit/GameKit.h: No such file or directory I could get around this with a #ifdef, but is there a better way? I'd rather tell Xcode to ignore the header altogether when compiling the mac target.

    Read the article

  • How to get a UIAlertView's result??

    - by cocos2dbeginner
    Hi, I implemented the gamekit. All works fine now. But if the user presses on send the data will instantly send to the other iphone/ipod/ipad and it will instantly written. So now i wanted to implemenr a confirm screen for the receiver. In my receiveData method (from the gamekit) i have an array. If the user presses yes the array will be written into a file.if not it wont be written into a file. #pragma mark - #pragma mark - GKreceiveData - (void) receiveData:(NSData *)data fromPeer:(NSString *)peer inSession: (GKSession *)session context:(void *)context { NSDictionary *dict = [NSKeyedUnarchiver unarchiveObjectWithData:data]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Incoming Set" message:[NSString stringWithFormat:@"%@ wants to send you a Set named: \n\n %@",[session displayNameForPeer:peer], [dict valueForKey:@"SetName"]] delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; [alert show]; [alert release]; } - (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { // the user clicked one of the OK/Cancel buttons if (buttonIndex == 0) { //NSLog(@"ok"); //this should happen if the user presses on ok on the alertview. [dataArray addObject:dict]; //i can't acess "dict" } else { //NSLog(@"cancel"); } } Do you see the problem?? What can I do??

    Read the article

  • Game Center alternatives for non-iOS development

    - by Eat at Joes
    I have completed a game for iOS which integrates GameKit. I am happy with Game Center however my game also has an HTML5 web version and will soo have an Android version. My question is what alternatives do I have for non-iOS platforms but primarily for Android and to a lesser extent a Javascript/Web SDK. I looked at Openfeint a year ago and it seemed to be a good solution back then but am not sure if this is still the case? Note, I have no plans to replace what I already have in my iOS game and I understand the leader boards, users, and achievements won't be shared out of Game Center.

    Read the article

  • Is there an AIR native extension to use GameCenter APIs for turn-based games?

    - by Phil
    I'm planning a turn based game using the iOS 5 GameCenter (GameKit) turn-based functions. Ideally I would program the game with AIR (I'm a Flash dev), but so far I can't seem to find any already available native extension that offers that (only basic GameCenter functions), so my questions are: Does anyone know if that already exists? And secondly how complex a task would it be to create an extension that does that? Are there any pitfalls I should be aware of etc.? ** UPDATE ** There does not seem a solution to the above from Adobe. For anyone who is interested check out the Adobe Gaming SDK. It contains a Game Center ANE which I've read contains options for multiplayer but not turn-based multiplayer, at least it's a start. Comes a bit late for me as I've already learned Obj-c!

    Read the article

  • Can a local multiplayer iOS game display differently for each device?

    - by Rahil627
    I've seen games which display different data for two devices, but not more than two. If possible, can it be accomplished using GameKit? EDIT: More specifically, I was thinking local multiplayer via bluetooth or wi-fi on an iOS device. Most games I've seen display the same screen synchronized across all of the devices. I understand games that network across the internet do this, often using a server, but I haven't seen any examples of a 3+ device local multiplayer iOS game. I just want to make sure it wasn't some kind of limitation.

    Read the article

  • Getting name of active wireless network iOS 3.1/3.2

    - by Typeoneerror
    Looking for a way to get the name of the wireless network the iPhone/Touch is connected to within my application. Is there a simple way to do that? I need to be able to notify users that they need to be on the same network as another Peer via GameKit. So, second question. Any chance I could see a list of available networks and names of peers connected to those?

    Read the article

  • What is the best way to implement a Server-Client connection between an iPad and multiple iPhones?

    - by Infinite
    Based on a college-project I'm trying to realize a relatively simple game (Poker) where an iPad acts as Server and multiple iPod-Touchs connect to it as Clients. Gamekit seems to drop out, since those old ipod-touch-devices don't have bluetooth-support. Are there already some Frameworks out there simplifying the process, or do I have to fall back on TCP-Streaming-Sockets and implement it myself?

    Read the article

  • iPod Touch (OS 3.0) bluetooth connection to non apple device

    - by Avi
    I need to know if I can programmatically connect my iPod Touch (OS 3.0) to a non apple blue tooth device, Using the Apple iPhone SDK. I know that I can connect to other iPhone using GameKit API, But can I connect to other non apple Bluetooth devices for example an measuring device that send out real time data over blue tooth?

    Read the article

  • Getting list of bluetooth devices nearby on iphone sdk

    - by Michael Cindric
    Hi Guys, I need to be able to search for all bluetooth devices nearby and just get there ids. I don't need to pair at all. I am using iphone 2.3 beta. Is this possible l have tried using GameKit and no luck does anyone know how to do this. BOOL result = NO; if (!session) { session = [[GKSession alloc] initWithSessionID:@"SCANNER" displayName:nil sessionMode:GKSessionModePeer]; self.session.delegate = self; [self.session setDataReceiveHandler:self withContext:nil]; self.session.available = YES; result = YES; } it dies on [self.session setDataReceiveHandler:self withContext:nil]; with the following error Scanner[42754:207] Error: 30500 -- Invalid parameter for -setDataReceiveHandler:withContext:. then ~ DNSServiceRegister callback: Ref=471fa40, Flags=2, ErrorType=0 name=00rusor1A..iPhone Simulator regtype=_q1eu29voete9jf._udp. domain=local.

    Read the article

  • iPhone Bluetooth application to connect to a Bluetooth printer

    - by Vijayanand
    Hi, Has anybody succeeded in developing a bluetooth application on the iPhone that prints to a Bluetooth printer? I have been investigating the feasibility of developing an iPhone application that could print to a Bluetooth-enabled printer. I've gone through the most of the postings in this thread and was confused by the mail exchanges. As per my analysis: Gamekit - can be used for bluetooth connectivity between iPhones and IPods ONLY Bonjour - can be used for wi-fi connectivity between iPhones/IPods and bonjour-enabled printer We can use an external accessory to connect to a third party Bluetooth-enabled printer provided the 3rd-party printer complies with the necessary regulations from Apple (registering for either “Made for iPod”/ “Works with iPhone”, and also customizing their printer with specific hardware/software, etc.) Could someone please share their experiences?

    Read the article

  • Broadcast-style Bluetooth using Sockets on the iPhone?

    - by Kyle
    Is there any way to open a broadcast bluetooth socket, take a listen and send replies? I want a proper peer to peer system where I broadcast and listen for broadcasts in an area. That way, variable clients can mingle. Is this possible? My theory is this: If GameKit can sit around wasting 25 seconds of the users time whilst having access to a broadcast socket, can't I? Or, must I be in kernel mode for such access? I'm not really sure where the proper bluetooth headers are as well. Thanks for reading!

    Read the article

  • Regular non-low energy bluetooth for IOS

    - by user3712524
    Ok, so I can't get my app to connect with a peripheral using bluetooth low-energy(my app is installed on an iPhone 5s and I have LightBlue installed on an iPhone 4S, simulating a peripheral. I also have light blue installed on the 5s, simulating a central, to verify that the two can connect and they do.) I have verified that the centralManager is instantiating and the State is powered on. So, my question is, is regular bluetooth still a viable option? Can I just use the GameKit API and go that route? Thanks in advance!

    Read the article

  • Multiple peers connected.

    - by Ranbeuer
    I'm developing a game that requires up to four iPhones or iPod Touch to connect each other to play in turns. My question is, how can I accomplish this via GameKit. I've read that using client/server sessions is the way of doing it. But I can't find any examples that would illustrate this. Is it really possible to do it, or there can only be two devices connected at a time. I'd really appreciate if you all could help me with a code sample. Thanks.

    Read the article

  • Understanding byte order and functions like CFSwapInt32HostToBig

    - by Typeoneerror
    I've got an enumeration in my game. A simple string message with an appended PacketType is being sent with the message (so it knows what to do with the message) over GameKit WIFI connection. I used Apple's GKRocket sample code as a starting point. The code itself is working fantastically; I just want to understand what the line with CFSwapInt32HostToBig is doing. What on earth does that do? and why does it need to do it? My guess is that it's making sure the PacketType value can be converted to an unsigned integer so it can send it reliably, but that doesn't sound all that correct to me. The documentation states "Converts a 32-bit integer from big-endian format to the host’s native byte order." but I don't understand what the means really. typedef enum { PacketTypeStart, // packet to notify games to start PacketTypeRequestSetup, // server wants client info PacketTypeSetup, // send client info to server PacketTypeSetupComplete, // round trip made for completion PacketTypeTurn, // packet to notify game that a turn is up PacketTypeRoll, // packet to send roll to players PacketTypeEnd // packet to end game } PacketType; // .... - (void)sendPacket:(NSData *)data ofType:(PacketType)type { NSLog(@"sendPacket:ofType(%d)", type); // create the data with enough space for a uint NSMutableData *newPacket = [NSMutableData dataWithCapacity:([data length]+sizeof(uint32_t))]; // Data is prefixed with the PacketType so the peer knows what to do with it. uint32_t swappedType = CFSwapInt32HostToBig((uint32_t)type); // add uint to data [newPacket appendBytes:&swappedType length:sizeof(uint32_t)]; // add the rest of the data [newPacket appendData:data]; // Send data checking for success or failure NSError *error; BOOL didSend = [_gkSession sendDataToAllPeers:newPacket withDataMode:GKSendDataReliable error:&error]; if (!didSend) { NSLog(@"error in sendDataToPeers: %@", [error localizedDescription]); } }

    Read the article

  • Two part question about submitting bluetooth-enabled apps for the iPhone

    - by Kyle
    I have a couple questions about submitting blue-tooth enabled apps on the iPhone. I want to first say that bluetooth is merely an option in the application. The application does not completely rely on bluetooth as there are many modes the user can go in. First, do they require you to have the "peer-peer" key set in UIRequiredDeviceCapabilities even if bluetooth interface options can be disabled or hidden for non-bluetooth enabled devices? Basically, it's just an OPTION in the game and there are many other modes the player can play.. Does Apple not allow you to do that? I'm just curious, because it seems like something they would do. Adding to that, how do you check for it's functionality at runtime? In essence, how do you check UIRequiredDeviceCapabilities at runtime. I'm aware of checking iPhone device types, so would that be a proper way of going about it? I'm also sort of unaware which devices can run bluetooth gamekit, there doesn't seem to be a proper reference at the SDK site, or I'm unable to find it. Thanks for reading! [edit] I can confirm the existance of somebody rejected for submitting a bluetooth enabled app which didn't work on a iPhone 2G.. Of course, they didn't say if that was the MAIN function of the app, though.

    Read the article

  • Which are the most useful techniques for faster Bluetooth?

    - by Mike Howard
    Hi. I'm adding peer-to-peer bluetooth using GameKit to an iPhone shoot-em-up, so speed is vital. I'm sending about 40 messages a second each way, most of them with the faster GKSendDataUnreliable, all serializing with NSCoding. In testing between a 3G and 3GS, this is slowing the 3G down a lot more than I'd like. I'm wondering where I should concentrate my efforts to speed it up. How much slower is GKSendDataReliable? For the few packets that have to get there, would it be faster to send a GKSendDataUnreliable and have the peer send an acknowledgement so I can send again if I don't get the Ack within, say, 100ms? How much faster would it be to create the NSData instance using a regular C array rather than archiving with the NSCoding protocol? Is this serialization process (for about a dozen floats) just as slow as you'd expect from an object creation/deallocation overhead, or is something particularly slow happening? I heard that (for example) sending four seperate sets of data is much, much slower, than sending one piece of data four times the size. Would I make a significant saving by sending separate packets of data that wouldn't always go together in the same packet when they happen at the same time? Are there any other bluetooth performance secrets I've missed? Thanks for your help.

    Read the article

  • iPhone: Which are the most useful techniques for faster Bluetooth?

    - by Mike Howard
    Hi. I'm adding peer-to-peer bluetooth using GameKit to an iPhone shoot-em-up, so speed is vital. I'm sending about 40 messages a second each way, most of them with the faster GKSendDataUnreliable, all serializing with NSCoding. In testing between a 3G and 3GS, this is slowing the 3G down a lot more than I'd like. I'm wondering where I should concentrate my efforts to speed it up. How much slower is GKSendDataReliable? For the few packets that have to get there, would it be faster to send a GKSendDataUnreliable and have the peer send an acknowledgement so I can send again if I don't get the Ack within, say, 100ms? How much faster would it be to create the NSData instance using a regular C array rather than archiving with the NSCoding protocol? Is this serialization process (for about a dozen floats) just as slow as you'd expect from an object creation/deallocation overhead, or is something particularly slow happening? I heard that (for example) sending four seperate sets of data is much, much slower, than sending one piece of data four times the size. Would I make a significant saving by sending separate packets of data that wouldn't always go together in the same packet when they happen at the same time? Are there any other bluetooth performance secrets I've missed? Thanks for your help.

    Read the article

  • How to iterate & retrieve values from NSArray of NSArrays of NSDictionaries

    - by chinjazz
    I'm stumpped on how iterate and get values for an Array of Arrays of NSDictionaries (different classes/entities). Here's what I'm currently doing: 1) Constructing two separate arrays of NSDictionaries (different entities) 2) Combining both arrays with: NSMutableArray *combinedArrayofDicts = [[NSMutableArray alloc] initWithObjects: sizesArrayOfDicts, wishListArrayOfDicts , nil]; 3) Then archive combinedArrayofDicts : NSData *dataToSend = [NSKeyedArchiver archivedDataWithRootObject:combinedArrayofDicts]; 4) Transmit over GameKit [self.session sendDataToAllPiers:dataToSend withDataMode: GKSendDataReliable error:nil]; 5) How would I manage traversing thru this array on the receiving end? I want to fetch values by for each class which is key'ed by classname: Here's how it looks via NSLog (2 Sizes Dicts, and 1 Wishlist Dict) Printing description of receivedArray: <__NSArrayM 0xbc65eb0>( <__NSArrayM 0xbc651f0>( { classname = Sizes; displayOrder = 0; share = 1; sizeType = Neck; value = "13\" or 33 (cm)"; }, { classname = Sizes; displayOrder = 0; share = 1; sizeType = Sleeve; value = "34\" or 86 (cm)"; } ) , <__NSArrayM 0xbc65e80>( { classname = Wishlist; detail = ""; displayOrder = 0; imageString = ""; latitude = "30.33216666666667"; link = "http://maps.google.com/maps?q=loc:30.332,-81.41"; longitude = "-81.40949999999999"; name = bass; share = 1; store = ""; } ) ) (lldb) In my for loop I'm issuing this: NSString *value = [dict objectForKey:@"classname"]; and get an exception: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM objectForKey:]: unrecognized selector sent to instance 0xbc651f0' Is this frowned upon as far as mixing object types in arrays of arrays?

    Read the article

< Previous Page | 1 2