Not sending turn with GKTurnBasedParticipant IOS 5 iphone - ios5

I am developing an app for iPad and iPhone with the Game Center Feature. The game is sending correctly one participant turns from iPad 2 IOS 6, but when I try to send the turn to another participant from an iPhone 4 IOS 5 the following error appears:
<GKTurnBasedParticipant 3d8e50 - id:(null) status:Matching outcome:None lastTurn:(null)>
2013-03-14 23:56:22.030 [453:707] ERROR::::::Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo=0x7a81170 {NSUnderlyingError=0x3f4220 "The operation couldn’t be completed. status = 5008, missing required key: turns", NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server.}
2013-03-14 23:56:22.031 [453:707] Oops, there was a problem. Try that again.
I am using the following method that works perfectly on IOS 6:
[currentMatch endTurnWithNextParticipant:nextParticipant
matchData:data completionHandler:^(NSError *error) {
if (error) {
NSLog(#"%#", error);
NSLog(
#"Oops, there was a problem. Try that again.");
} else {
NSLog(#"Your turn is over.");
}
}];
The error number 3 is GKErrorCommunicationsFailure,but I cant understand what it is going on!
I logged on correctly when the app starts with the Game Center

This error will always come when you are working on Simulator instead of device, but sometimes it pops out on device, because of Push Notification Failure,
Please check if you device is receiving Push Notifications.
UPDATED
I recently figured it out that Game Center does not send push notifications to devices which does not have sim card inserted

Related

Notification not getting shown in one of IOS device

I am facing problem with notification. Notification is not getting shown in device from last 12 hours. It was working earlier. Sending to other devices works fine.
I checked notification center and other thing. Notification is enabled for app.
After following
http://developer.apple.com/library/ios/#technotes/tn2265/_index.html
I have enabled Enabling Push Status Messages on iOS.
On console , device is printing some information like:
<Error>: kDataAttachStatusNotification sent, wasAttached: 1 isAttached: 1
What does it mean ? Is it getting notification from server side and failing to show and receive due to some reason ?
Edit:
After syncing logs with itunes. Logs says something like:
2013-08-01 10:51:06 +0530 apsd[76]: _getClientIdentity: already had identity: <SecIdentityRef: (some value here)>
wasUp NO isUp NO linkQualityBelowAndWOWAvail: YES wantsInterfaceAssertion YES avoidWWANOnCall NO
2013-08-01 10:51:06 +0530 apsd[76]: _getClientIdentity: already had identity: <SecIdentityRef: (some value here)>
2013-08-01 10:51:06 +0530 apsd[76]: peer(68) received XPC_ERROR_CONNECTION_INVALID
Have you requested permission from the user to present notifications?
Try adding the following code to your AppDelegate's application: didFinishLaunchingWithOptions: method:
Swift:
if (UIApplication.instancesRespondToSelector(Selector("registerUserNotificationSettings:"))) {
application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: .Alert, categories: nil))
}
Objective-C:
if ([application respondsToSelector:#selector(registerUserNotificationSettings:)]) {
[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert categories:nil]];
}

Facebook image upload on a page working properly in simulator but not in device

When I run same code in simulator I get success Response for image post:
{
id = 248572435289479;
"post_id" = "244759709004085_248572441956145";
}
When I run in same code in device I get:
Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x208a8dd0 {error={
code = 1;
message = "(#1) An unknown error occurred";
type = OAuthException;
}}
"
OAuthException means that there was an authentication issue. Be sure that the following are true on your device.
You are logged into a facebook account successfully
If you are, then remove the app from the phone
Do a clean and re-deploy to the phone
If none of the above work, try logging out in Settings on the phone and logging back in. Then try logging in through safari. Sometimes the iOS facebook authentication can be a little buggy. Also try a different app that is guaranteed to work with iOS facebook accounts. Something like, Hootsuite.
If there is still an issue after all that... I am not sure what you tell you.
This link might help you.
and #giff's answer also explains it to some extent on this link.
log of your issue in this might help you to get further detail of your error.
- (void)request:(FBRequest *)request didFailWithError:(NSError *)error {
NSLog(#"%#", [error localizedDescription]);
NSLog(#"Err details: %#", [error description]);
};
I recommend you to try this if none of the solutions given above could help you.
Remove the application from the list of authorized applications and authorize it again with the needed permissions.
Hope this works for you

Game Center Error

I am following a tutorial here . Multiplayer Game iOS
I am using following code from above tutorial for Match Making
GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease];
request.minPlayers = minPlayers;
request.maxPlayers = maxPlayers;
request.playersToInvite = pendingPlayersToInvite;
GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
mmvc.matchmakerDelegate = self;
[presentingViewController presentModalViewController:mmvc animated:YES];
When I search for other players using Play Now option, the GKMatchmakerViewController dismissed immediately delegating matchmakerViewController:didFailWithError with following error.
Error Domain=GKErrorDomain Code=3 "The requested operation could not be
completed due to an error communicating with the server." UserInfo=0x2081d8d0
{GKServerStatusCode=5001, NSUnderlyingError=0x2086c560 "The operation couldn’t be
completed. (GKServerErrorDomain error 5001.)", NSLocalizedDescription=The requested
operation could not be completed due to an error communicating with the server.}
I have not been able to figure why is it happening so. The same code was previously able to search and find appropriate players but failed when fetching player aliases using
[GKPlayer loadPlayersForIdentifiers:match.playerIDs withCompletionHandler:^(NSArray *players, NSError *error)
with 'Could not communicate to server' error.
The code however, works fine on simulator.
I also got
Error Domain=GKErrorDomain Code=3 "The requested operation could not
be completed due to an error communicating with the server."
UserInfo=0x17007e4c0 {GKServerStatusCode=5001,
NSLocalizedDescription=The requested operation could not be completed
due to an error communicating with the server.,
NSUnderlyingError=0x170050140 "The operation couldn’t be completed.
(GKServerErrorDomain error 5001.)
I think this is sandbox.gc.apple.com problem..
this question is one year but apple still have this problem sometime
Wish apple fix this soon.
I try on iPod touch and I got
Error Domain=NSURLErrorDomain Code=-1001 "The request timed out."
UserInfo=0x176bec90
{NSErrorFailingURLKey=http://sandbox.gc.apple.com/WebObjects/GKInit.woa/wa/getBag?ix=1,
NSErrorFailingURLStringKey=http://sandbox.gc.apple.com/WebObjects/GKInit.woa/wa/getBag?ix=1,
NSLocalizedDescription=The request timed out.}
Having the same problem (GKServerStatusCode=5001) when sending new high score using reportScoreWithCompletionHandler.
In sandbox mode all is OK, but AppStore version has this issue on all devices where sandbox mode was enabled (iOS 8.2 / 8.3). But I can see data from other users in leaderboards. Looks like this is actually bug on Apple's side.

IApp purchase doubts in iphone

Ha ii,everybody.I have a reader application which has a database downloading option through inapp,that is,the user can download the diffrent languages of databse(Sqlite) through inapp.I i added the classes from MugunthKumar classes and added it into the project.I have 5 buttons hindiDB,HebrewDB,japaneseDB,portuguesDB etc,etc.If the user tap any of the button above it will automatically connect to in-app and if the payment done ,it need to download that DB to my app.I write this code in one of my button click:
-(IBAction)_clickbtnhindilang:(id)sender
{
[[MKStoreManager sharedManager] buyFeature:kFeatureAId
onComplete:^(NSString* purchasedFeature)
{
NSLog(#"Purchased: %#", purchasedFeature);
}
onCancelled:^
{
NSLog(#"User Cancelled Transaction");
}];
}
and the console shows that it cannot built in ios stumulator and ned to build in realdevise,so i build it with a real devise and the console shows
Review request cannot be checked now: (null)
2011-12-06 14:39:33.958 Bible[965:707] User cancelled transaction: <SKPaymentTransaction: 0x373110>
2011-12-06 14:39:33.961 Bible[965:707] error: Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo=0x3dc4d0 {NSLocalizedDescription=Cannot connect to iTunes Store}
I didnt know how to do a inapp purchase.How can done this with MukunthKumar storekit class.
Thanks in advance.
Look here
http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/
And slow down a little bit, your rush will prevent you from learning.
Shani

iPhone GameKit: Communication with Sandbox - GKErrorDomain Code 3

Anyone has any experience with GameKit GKErrorDomain Code 3? I receive the error message when I try to upload a score to a leaderboard in the Sandbox. The iOS reference library just says that Indicates that an error occurred when communicating with Game Centre The Here is the full error message:
Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo=0x75e4eb0 {NSUnderlyingError=0x7531e00 "The operation couldn’t be completed. status = 5053", NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server
The environment:
The request is being made from the 4.1 Simulator
GameKit has authenticated the local player who has logged into the Sandbox
The leaderboard with the name "Standard" has been created on iTunes connect
I can browse the web in the simulator
Here is the code I use to upload the score
GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:#"Standard"] autorelease];
scoreReporter.value = 10;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error)
{
if (error != nil)
{
// handle the reporting error
NSLog(#"An error occured reporting the score");
}
else
{
NSLog(#"The score was reported successfully");
}
}];
One reason (which is the reason that was affecting me) for GKDomainError Code 3 is if the Leaderboard Category Id specified in the initWithCategory message when initializing GKScore is incorrectly specified.
It's easier to track down if you print out the error.
Etc:
NSLog(#"An error occured reporting the score: %#", error);