Sandbox Game Center Turn Event Notifications Not Consistent - iphone

I'm making a turn-based game, using the Game Center Turn-Based Gaming functionality. I'm using the simulator and my iPhone to test notifications of turn events. The results are very inconsistent. About 75% of the time when I make a move on the simulator and pass the turn I don't get any notifications on my iPhone. It seems that this function doesn't get called:
handleTurnEventForMatch:didBecomeActive:
I set the GKEventHandlerDelegate in the code that authenticates the local user and it seems to be set correctly. The fact that I get notifications once in a while suggests that this isn't where the problem lies.
Does anyone have any idea what could be the problem here? Could this be a problem with the Sandbox Game Center Server? Do they limit the amount of notifications you can send in a short amount of time or something like that?
Edit: I just found some posts of people experiencing the same problem, but no solution. No very recent posts though. Any updates?
Edit2: I also find that after a move, when I open the GKTurnBasedMatchmakerViewController on the other device it still says that it's the turn of the other player. When I close and reopen it the information is correct. Also, when I open the game GKTurnBasedMatchmakerViewController when it's still showing incorrect information, it does gives me the correct match object with the updated information. Could this be related in any way?

I thought I would share my solution with you, in the hopes that it is the same problem you are experiencing. As you can see from my comment to your question, I was having the same issue as you. It turned out that my settings in iTunes Connect were the culprit, unbeknownst to me. What you should check for is that you still have Game Center enabled in BOTH places that iTunes Connect requires. First, after going into "Manage my Apps" in iTunes Connect, select your app and on the right menu, and click "Manage Game Center". Make sure this is currently enabled. I would even recommend disabling it, and re-enabling it again for good measure.
In addition (and this is what I was missing), you must enable it in one more place. Go back to the previous screen when you first select the app. The top right is where you can select Manage Game Center, but we are looking on the bottom in the "Versions" section. Click the View Details button for your app, and make sure the Game Center button is enabled near the bottom. Again, I would disable and re-enable it here as well. Give it about 10 minutes, clear all your open turns and matches from the Game Center app (this might be an optional step), and build & run again. Hopefully, you will receive turn notifications properly again.

I got the same problem. However when i tested it on multiple devices it was working fine... May be some problem with the simulator

Related

Apple Watch Prevent from being inActive when User wrist down

I want the specific behaviour from my apple watch, i am developing a Fitness app in apple watch.
Problem:
When user will be on some specific screen (e.g. Download ODRs from firebase). user faces issue that when user slightly down their wrist and Screen goes deem and Refresh rate goes to 1 FPS. Client has special requirement that Screen should not go to Sleep When that particular downloading process is running.
References(Example):
I tried to find solution everywhere and found some questions also over StackOverflow about this but there also saying not possible so i still haven't found anything related to this but i have found one example that is doing this behaviour is Apple watch app Mindfulness. When user runs this app and start the session as much time user will be on that screen watch will not go to inactive state no matter user raise the hand or lower down the hand.
i want to implement that same behaviour in my app. Client wants no mater what ever it takes make it work. (No issues with battery life also or Computation). i may need to implement this kind of behaviour in other screens as well.
I have tried one solution that is to Turn on auto Rotate so that when user slightly turns their wrist it will rotate instead of going to Sleep or inactive state, but it isn't the solution and looks like something weird behaviour
I have also tried TimelineView() but it will be useful once watch goes to inactive state and also it is useful when doing computations but if i have to update UI it will only do it at 1FPS in inactive state no matter how frequent your data is updating.
Thanks in advance :)

GKTurnBasedMatch push notifications are very inconsistent

I'm testing a turn based game between two devices. As far as I understand, sending a turn with [GKTurnBasedMatch endTurnWithNextParticipants:], for example, should automatically push a game center notification to the opponent. Sometimes, this works just as expected: the turn is sent and right away a banner notification shows up on the other device. All is well.
What is baffling me is that other times, even though the turn itself is sent properly (I can tell because when the opponent refreshes the matches, the match is up-to-date), there's no push notification coming in.
Are there any holes in my understanding here? If I'm understanding correctly, the inconsistent notifications shouldn't have anything to do with my code, because the issue here isn't how I handle notifications, it's that there is no notification at all. In other words, [handleTurnEventForMatch:] (aGKTurnBasedEventHandlerDelegate method) doesn't have anything to do with it (I don't think) because if no notification is being received, it's never going to be called anyway.
So, I'm just wondering if anyone has had any experience with this. Is it possible that this is due to something in my code? Or, is it possible that the Game Center sandbox is responsible for the inconsistencies, and there's nothing I can do about it?
Any thoughts or ideas would be much appreciated.
It is an issue with GameCenter's sandbox mode. In order for your device to enter sandbox mode you have to open/run your app and authenticate game center. If you say, open a different (published) game after your game is open it will leave sandbox mode and and go back to regular game center mode.
Even if your game is running in the background, as long as it is the last game-center enabled game opened you should get the push notifications as normal. But if you open the game, and then kill the process, you will no longer be in sandbox mode and will not receive the push notifications.
For those who are experiencing similar problems: this turned out to be a Game Center sandbox problem. It had nothing to do with my code, and things were fine in the App Store release. So, read through the comments here and make sure there aren't other things factoring into whatever issues you're having...but know that it's possible that you're simply experiencing some Game Center sandbox issues that are out of your control!
I am also facing the same problem. My game stops receiving turn events and turn notifications from Game Center, I finished my game and was testing, but this week, the problem started to happen. It was working like a charm but suddenly instances started not to receiving turn events for a couple of days.
I am using the iOS7 SDK and targeting iOS7 (turn event handling is different than prior iOS versions, I will need exchanges in upcoming game features, that's why I am using iOS7).
Then I made a test app to check if it was same with iOS6 and prior SDKs, but no help, it was same. So don't waste your time to upgrade your code to iOS7 hoping it would work, the problem is there. I also tried many things, like resetting devices and settings, using new users, etc.
I also tried it with Ray Wenderlich's Turn-Based Gaming with iOS 5 tutorial, by downloading source code, and it doesn't work neither.
The thing is, usually when I launch the game, game receives turn events, but after a few turns, it just stops, and when it stops receiving, stops like forever. If I reload the match, I can get the updated match and it's data is also updated, so I can make the turn. It means match is updated on Game Center. So, either Game Center is not pushing the data to users (possibly this is happening because user cannot receive notifications from Game Center when the game is in background), or the GameKit is not firing the event to the handler.
I don't know why it is happening, or why it started to happen, but I can't release my game like this, hoping that it would work out of sandbox. I will be trying a couple of more things (like maybe trying turn reminders of iOS7, to see if they push it to the user), then I will ask to Apple's support team. One other thing i am planning to do is, putting my test app to App Store and see it if works out of sandbox.
Hopefully it is a sandbox problem.

Record iPhone screen and user's actions

In order to do usability testing I'd like to record an iPhone's display along with every user action. I can't modify the application itself however jailbreaking the phone wouldn't be a problem.
Ideally I'd like to get a full resolution video of the screen display with an overlay showing touch events on top of it.
For now the best solution I've found is using a video-out cable and record its output, but with this solution I'd need an external camera to capture what the user was doing and it wouldn't be very precise.
Other ideas?
The application display recorder, found in the big boss repo (cydia) works very well for this.
I have tried MirrorOp (requires JailBreak) and AirSquirrels' Reflector (no JB required) for usability testing. Both work very well, but none grab touch feedback. You can use a second camera or a Hug the notebook approach.

Intraweb for iphone, how to keep the webbrowser hidden

I've just written my first app in intraweb (control pack for the iphone)
It works, but after several hours I still cannot get the iphone to not show safari.
I've added a link to my homescreen and I start the (web)app from there and things start out ok.
But when I change a page safari shows up and breaks the look I'm an iphone appĀ® magic and eats up 25% of my screen.
The intraweb documentation says this is due to the fact that the webadres changes (parameters in the url), so I switched to hidden fields, but to no avail.
How do I make sure my iphone webapp stays full screen and never goes to safari?
It works for me, and I suggest you ask in the TMS Software newsgroups, with steps to reproduce this behaviour, so they can look into it (which will give you a better chance of solving the issue that asking here, to be honest)...

Temporarily Lock or Disable iphone home button

I know the iphone home button is extremely crucial for the functioning of the iphone.
However I have an idea for which I need the application running and the home button to be disabled. I tried googling, but haven't been able to find a solution.
Temporary or timed locking (Lock for 5/10 mins.) would also do.
The app. should work on non-jailbroken phones, hence going around apple won't work.
Appreciate any ideas.
Note, from 2014 onwards: just to be clear,
this is now built in to iOS...
Click to accessibility, click "guided access".
Conrats for "inventing" it, PlanetUnknonw! :-)
The answer below is only of historic value...
For the record, it's silly that people are saying "Why would you want to do this?"
it's a great idea for example for APPS FOR SMALL CHILDREN (which is indeed a very large market on the iPhone).
If you've ever marketed an app for small children, you'll know that instantly parents write in abusing you because you "did not stop that stupid home button working, so the child just turns off the game and makes phone calls"
To which you have to reply that it's of course not possible because of the way the iPhone works.
So yes it's a good question. As far as I know, Planet, it is not possible.
Apple should add a "kids mode" where parents can lock the fone on TO one particular app for awhile. (Perhaps you would have to long-press or something the home button to unlock it.)
UPDATE
*iOS 6 reportedly has a "Single App Mode" - Check out vpdn's answer below https://stackoverflow.com/a/10503799/333259
This is against the iOS interface guidelines, and apps have been rejected for "overriding" or restricting behaviour of hardware buttons/switches.
I suggest you have a read of the App Store Review Guideline for iOS apps for a good overview of what you shouldn't be doing.
Particularly:
10.5
Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, will be rejected
Pretty sure that the Home button is included in that.
I'm not sure what your "idea" is here, but I would suggest you look into other things such as backgrounding. There is a feature that allows you to finish executing tasks in the background, even if the user presses the home button, and optionally display a notification after certain time (before the task "expires"). I imagine that this might offer a more appropriate solution (again dependent on what your idea actually is).
In iOS6 (to be released), there's a feature called "Guided Access", which will allow device owners to lock users (like toddlers and school kids) into an app.
Update: Before the shitstorm about NDA content starts, here's where I got the info from: http://www.theverge.com/2012/6/11/3078350/apple-ios-6-guided-access-parental-control
You can't unless you want to run it on jail broken devices.
Apple currently will not allow any software to disable or change ANY button functionality for iPhone, iPad, and iPod touch, so the only software solution is to jailbreak the device, so you're not forced to live by Apple's rules.
However, PaperclipRobot.com is about to release a home button cover specifically targeted to keeping young kids from pressing the home button. Not the exact solution to your problem as stated, but I figured it added to the discussion.
Unsure if you are looking for a way to do it in code in an app or if you're thinking of locking it in general.
Anyways, if you're looking for a way to do it in general, here's a guide for it
http://igrudge.net/how-to-disable-the-home-button-on-ios-devices-iphoneipad/
If you are looking to temporarily disable the home button to keep a child in a particular app, the tip for a make magazine article is to use a bulldog clip to cover the home button cheaper, and more reusable than a bubcap, temporary and effective.
Source: http://blog.makezine.com/2011/03/01/ipad-home-button-child-lock/