GKTurnBasedMatch push notifications are very inconsistent - iphone

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.

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 :)

Sandbox Game Center Turn Event Notifications Not Consistent

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

How to extend Unity Application?

I know I should post that question at Unity's Q&A but unfortunately they're pretty unresponsive. :P Anyway, Urban Airship requires me to extend Application instead of (as usual) Activity. Is there any way to do that in Unity?
I tried extending Activity instead but it works only partially. It works and I get notifications on my phone but only when the app is actually running (should work too if it's not) and when I tap the notification it crashes my app. As I've read here: Re-launching android application when user clicks Urban Airship notification the problem was that I extended the Activity instead of Application. If extending Application is impossible in Unity is there any way to work around this problem?
Finally found it (should have days ago but google kept giving me wrong results :():
http://forum.unity3d.com/threads/126833-Can-the-Application-class-be-overridden-or-extended-in-a-plugin

iPhone background operations/daemon with live chat module. Keeping the app alive?

I am building a live chat app for the iPhone, and for this it is necessary to ensure that the operator is online and to keep the flow of data going.
After much search it seams to be only two options for similar kind of behavior;
UILocalNotification, only works if I have some scheduled information notice to be sent
Push Notification, for pushing data to the phone
The problem with push notification seams to be that I cannot ensure that the user is available, or in any way talk with the app without the user re-opening it. This way it seams impossible for me to know if the user is online, to update data in the app without the user having to manually open it, etc.
So, what I ask for, is it in any way possible to keep the app active in the background thus ensuring the operator is online and notify of incoming chat sessions?
Thanks a lot for your help guys!
Unfortunately the answer is no. I take it you mean text chat and not VoIP (which CAN run in the background)? Your best bet would be Push Notifications, as you would not be able to monitor anything from the app itself when it is in the background.

Submitting my app to the store without the intention of selling it

I'm building an iOS game that will have both singleplayer and multiplayer modes. I'm building the game in two different phases, one for singleplayer and then a second for multiplayer. The singleplayer phase is complete and it's completely shippable. I was thinking about submitting it to the iTunes store before I implement the multiplayer mode so if it gets rejected for any reason, I can fix those issues ahead of time. However, if it gets approved, I don't plan to release it until I finish the multiplayer mode and submit it as an update.
Is this a good/bad idea?
Do other people do this?
Thanks in advance for your help!
Its better you complete the application and then submit it, and app can get rejected for any unknown reason - So I would say just complete the application and submit it. If you know for sure that your app is going to get rejected - then you can submit the app in single player and set the release date to after one month or even a year and complete the multi player mode.
Just make your release date infinitely long. This way when it is approved, no one will see it. Then you can kill the app if you want after it is approved.