GameKit authenticateWithCompletionHandler stuck - iphone

I'm having a classic everything-worked-yesterday-nothing-works-today kinda day.
I set up Game Center yesterday. Managed to log in, get leaderboards, get achievements etc.
Today, everything stopped working. authenticateWithCompletionHandler doesn't call the completion handler, even for an error.
I tried several iPhones, rebooting them, rebooting the mac, deleting and installing the app and more (all hints gathered from the internet).
I figured it was a temporary Game Center Sandbox issue, but then noticed it was working fine on the simulator. So I retargeted my own code, had another reboot, and now it doesn't even work on the simulator!
When I try to open the Game Center App it's in "Loading..." state, and doesn't get out of it.
What am I doing wrong? What happened between everything was working, to nothing is?

Log out of your current GameCenter account in your iphone.. Install the app again and launch the app.. Note that it should prompt you to sign in.. If not, check your codes to ensure that it calls the function to authenticate the user is being called..

Related

iPhone Project Not Running (more than once)

I have an iPhone app that I'm trying to run on my phone via Xcode.
It installs and runs without an issue
I make a change in the source code (negligible, like an NSLog())
It installs without an issue
Running causes the error:
Error Starting Executable 'myApp'
Don't know how to run. Try "help target".
I uninstall the app, and reboot the phone
It installs and runs without an issue (until I make another change; then I have to repeat this dance)
Needless to say, having to uninstall the app, reboot the phone, and reinitialize the environment (i.e. set prefs) takes an unreasonable amount of time, and is probably indicative of a serious problem. The issue is, the only vague error message I receive gets me nowhere on Google. Where on earth could this issue be coming from?
With some help from #iphonedev, I figured it out. Turns out it's a glitch in iOS 5 beta. The way to fix it is to remove the device from Development Devices, then re-add it.
Yeah just restarting the iPhone with the lock and home buttons fixes this. Had it happen a few times to me

CLLocationManager not prompting the user and returns NULL

Till yetsterday everything was working fine on my iPhone. Starting today, I noticed that CLLocationManager does not prompt the user "this app wants to use your location" and proceeds to return me null in the didUpdateToLocation. I have tried signing my app with dev provisioning, adhoc and prod profiles. Also, I am making sure that I delete the app before trying this. Earlier the moment I would run the app first time, it would prompt me for push notifications and GPS prompt. But now, none of these prompts are showing up.
My App does a CLLocationmanager startupdatingLocation in AppDelegate --> applicationdidLaunch and applicationdidLaunchwithOptions. Also, CLLocationManager does not call my didFailWithError.
Replying to myself. I was using testflighapp.com for beta testing and I am not sure if that was causing it, but all I had to do was go ti iPhone-->Settings-->General-->Reset-->Reset Location Warnings.
Once I did that and ran my app, it did prompt me for GPS and everything started working fine after that.

iphone app cant be started on device after being killed - works fine on simulator

I want to put an update to my App and I'm encountering heavy issues. When sent to background and being brought back to foreground, the App works fine. However, after killing the process from multitasking (running in the background), the App tries to resume from the point where it left AND it freezes, which means, I cant start the App anymore!!!! I have made no changes to the code, except updating my OS from 4.0 to 4.0.1.
Can anyone help me out on this?
A weird thing is: I cannot reproduce this problem on the simulator, it works just fine there.
I seem to have found the solution. Apple states in the updates: 'When debugging your multitasking enabled app, avoid manually pausing and continuing from the debugger when the application is suspended in the background. Pausing an application that is suspended in the background disrupts proper multitasking behavior until the application is relaunched.' So I tested it on a device for distribution and it seems to work fine, so all you have to do is ignore the debugger - it seems. Best of luck!
My app works fine for me in Debug mode (I'd advice against working with Distribution mode cause of all the hassle of provisioning profile, iTunes sync... and also you can't see the console message in real time).
The reason you can't do anything after killing the app and relaunching it is most likely because you run it directly from XCode (Command + Enter) and the app is still "running". Just click to the Red button to stop the debugging, then you can relaunch the app from the SpringBoard normally. Or just Command + Enter to rebuild it again.

iphone - debugging on device crashes immediately

When I try to debug my app on the iphone device, the splash screen shows and then the app crashes immediately. If I run the app in the simulator or on the device (not from XCode) it runs fine. I tried putting a breakpoint in the main method and it doesn't seem to hit it. There are no logs generated. ideas? suggestions?
Are you using a Apple Developer account or have you hacked the phone to develop on it? If its hacked, that is probably the problem. There is extra data being passed to the device because of the hack causing it to crash. Not sure if there is an easy work around except paying for a developer account.

iPhone app was working, suddenly starts crashing on startup, reinstall fixes, but why?

Here's the situation:
-Had a development build of the app we just submitted on my phone, working fine for days (and previous builds worked fine for weeks).
-Yesterday, I touched the app icon, the app launches then crashes out (I wasn't connected to my computer at the time, but if I had to guess, it was around or before when applicationDidFinishLaunching runs). Basically, I briefly see my Default.png, then the app closes. This happens every time I try to run it.
-I restart my phone. No difference, the app is still failing to launch. All other iphone apps I have appear to be working fine.
-This morning I reinstall the app from my development computer and all is well, it's working fine again. No problems. This is the SAME EXACT CODE with the same build parameters.
This has me really worried, does anyone have any idea at all what might have happened? It's like the app permanently broke itself, before it even hits any of my code no less :(. I had a theory it might have had to do with an expired provisioning profile, but I didn't get any message then or when I reinstalled.
I'd appreciate any advice/pointers/ideas people have!
Connect your iPhone to the computer, launch XCode, go to the Window menu, and select Organizer. Click on your device in the left hand bar, and check your crash logs.
That should tell you when it is crashing, and why.
Actually, the crash logs should still be there from when your app WAS crashing, so even if you have reinstalled, you may be able to figure out what WAS going wrong.
Are you using core data?
Did you change your schema? That would cause a crash on startup and a reinstall would then fix it.
If it was the exact same code it seems to point to a data issue.