Game Center authentication doesn't work in iOS 8 - ios

I am trying to implement Game Center in my game. I've tried it on the iOS 8 GM.
I'm not able to get the authentication to work on device, but it works fine in the simulator. I'm using the code provided in Apple's documentation.
Do other people have the same issue? Any advice?

Happened to me as well in iOS8. Just need to enable Sandbox in Settings--> Game Center --> Sandbox.

In order to make it works you must be sure that:
The SandBox Mode it's Enable on your device
Your bundle id on Xcode must be the same bundle id on Itunes Connect
You have to enable the Game center on itunes connect:

Go to itunesconnect website (https://itunesconnect.apple.com)
Open Your app. (in My apps section)
Find "Game Center" tab. Click it.
Then click on switch "Enable/Disabled"

Related

How to setup Xcode automatic signing for iOS apps

I'm trying to finish up a small game I'm writing in Xcode for iOS.
I have a valid developer account and team setup and I've followed the simple procedure outlined here;
https://developer.apple.com/library/content/qa/qa1814/_index.html
But when I try to add Game Center capability in Xcode I get and error that states that I should "Add the Game Center feature to your App ID".
Game Center Capability Warning Message
But then there is no matching App ID in my developer Web site and I can't add it either as it complains that "An App ID (with my App ID) is not available".
Frustrating as hell, tips appreciated.
Have you added your Apple Developer account to Xcode via the Xcode Preferences screen's Accounts tab?
If you have not added your account there, add it and then try switching the Game Center capability on and off for your project.
If you have added the account already, then try exiting Xcode and restarting it. Sometimes Xcode appears to get a bit "confused" after it has been running for a while and a simple restart seems to fix a lot of issues :)
If neither of the above helps, let me know and I'll try to help you figure out what is going on.

iOS Simulator not giving me sandbox option for Game Center

I'm making an iPhone SpriteKit-based game, and I just added all the code for game center, but when I try to run it I get a pop-up window that says, "Game Center unavailable, player is not signed in". So I was looking through the game center programming guide and it says that I am supposed to enable the sandbox option, but when I go into Settings then Game Center, there is no option to enable the sandbox. I only get an option for logging. I was wondering how I can enable sandbox in Game Center so I can hopefully solve this issue.
Have you viewed this link?
You may need to sign out of your GameCenter account before you can do this.
When I signed into Gamecenter, signed out, signed back in then switched to myapp I see "Welcome back sandbox". It looks like Sandbox is automatic in the simulator.

iOS 8 beta 5 Game Center Sandbox won't recognize my app

I trying use GC sandbox in game, on iOS 7 it works fine, but on iOS 8 beta5 GC authentication return error "The requested operation could not be completed because this application is not recognized by Game Center". In production GC work fine on iOS 7 and 8 beta5.
You should turn on the GC sandbox mode.
go to settings --> game center
scroll to the bottom, there is a "sandbox" swith under "developer".
(Important! - These developer options are hidden until you have connected the device to XCode 6. If you didn't use XCode and deployed your app in some other way - e.g. Testflight, iPCU, iTunes, then you will not see these options)
If you aren't seeing the sandbox switch under Settings > game center (developer section), then you need to connect the device to XCode
OR:
Use Apple's testflight iOS app found here on the App Store:
https://itunes.apple.com/us/app/testflight/id899247664?mt=8
That will enable the developer Sandbox switch as well. Using the old testflight web link tool on iOS doesn't enable the sandbox switch.
If you plug in the device and then look at the settings/ gamecenter. The setting for the sandbox will show up.
Was having the same issue and solved it by adding a leaderboard in iTunes Connect.
Make sure you add an app to iTunes Connect and enable Game Center for it, not just the provisioning/entitlements. Then I added a leaderboard as Alcides Eduardo Zelaya suggested.
From the GKLocalPlayer docs:
Receiving a GKErrorGameUnrecognized error means that you have not enabled Game Center for your app in App Store Connect. Sign in to your App Store Connect account and verify that your app has Game Center enabled. Also, confirm that the bundle identifier in your Xcode project matches the bundle identifier you assigned to your app in App Store Connect.

IOS Game Center on iPad simulator not working

I believe this question has been asked before but the solution(s) offered were not relevant or applicable to me.
I am halfway through coding a game app and have just added basic Game Center functionality to my app - it just checks if the user is signed into the Game Center upon startup. If not, it should show a pop-up box prompting the user to either sign in or cancel. When I ran the app in my iPad simulator, I realised it was not doing anything. When I tried running the Game Center app itself in my iPad simulator, I realised that I could not sign in with my usual iTunesconnect account - it just kept hanging. When I tried to "Create new account", it said "Game Center account services are currently unavailable". However I am able to use the Safari app in the simulator to access the web.
I have an iPad at home which is connected to the internet via the same router (so it cannot be a firewall config problem) which is always on Game Center. When I got the error message on my simulator, I checked the connection on my iPad and I was still logged into the Game Center. When I tried signing out, I could sign in again immediately without any problems. So I tried testing my app in my iPad instead - I got xCode to build the app in my iPad. When I ran the app, it popped up the pop-up box, saying it was using a Sandbox account, and prompted me to sign in with my itunesConnnect account so I did so, but nothing else happened - however I had not programmed any further Game Center functionality into the app. When I quit my app and tried running the Game Center app from my iPad, it started behaving like the iPad simulator -- it would hang when I tried to sign in with my iTunesconnect account, and when I tried to create a new account instead, it would tell me that the services were currently unavailable... when barely 10 mins before, before I installed and ran my app, everything was working OK.
Could I have hosed some settings in my iPad Game Center and now it won't work?? I do not understand how installing my app could have affected the Game Center app in any way. Now both my iPad device and my simulator will not sign into Game Center.
PS: I have checked my /etc/hosts file etc. on my computer and it is the default file, it cannot be a problem with my firewall because I was always able to access Game Center on my iPad before this. Does anyone have any ideas? This is driving me crazy and I wonder if I have to resort to clicking "Restore" on my Ipad to bring the Game Center back. But it still won't solve the problem with the simulator on my Mac not working.
Thank you for any suggestions!!!!
Artie
I've struggled with exactly the same symptoms over the past few days. In the end, I had to disable my firewall (running on a 3com ADSL OfficeConnect), then the sandbox mode works. Interesting notes:
Like you, I was just attempting to set up GC authentication to a sandbox account at this point.
I can access the non-sandbox GameCenter servers with the firewall running on high. Access to normal GameCenter doesn't imply it isn't a firewall problem.
This is a common hardware router/firewall, and I wasn't blocking any particular ports.
This is repeatable -- toggling the firewall on and off prevents/allows access to the GC sandbox servers.
[Speculative: the firewall's logging is pretty useless, but it reports a (non-existent) TCP FIN scan -- the "high" settings may be a bit sensitive. Doesn't make much sense that this would only affect access to the sandbox servers, but empirically, it does.]
In order to use Game Center on a test app you have to set up development Game Center (sandbox) accounts specific to your app and use those to log in and test game center features.
You can read the Game Kit Programming Guide: Game Center Overview to make sure you have everything setup correctly on the Apple server side before adding game center code to your app.
Close your app and any other Game Center apps. go to Settings->Game Center - click on your connection name and select Sign out. Next run a game Center app that you did not write (EX angry birds) logon into to game center (tara) you are no longer in sandbox

iOS apps without developer license / app store

I'm new to iPhone development and was wondering if there is a good/easy guide I could follow to install an iOS app on a jailbroken phone without joining the developer program.
Basically, I don't know if I'm going to have the time to learn everything I need to learn, but would like to make a start and see where it leads. Once I have something decent put together I can make plans to go through official channels.
I followed a guide that I found in SO, but when launching the app it immediately dies/crashes back to the springboard. So I can only assume I did something wrong, or the guide is outdated.
I'm using iOS 4.3.3 and xCode 4.
here is the link to the guide I followed: iPhone App Minus App Store?
Thanks
Just to get the warning away.
I just found a guide that worked for me: How can I deploy an iPhone application from Xcode to a real iPhone device?. all I had to do was change the 4.2 in one of the commands to 4.3
With Xcode 7 it's now free to run your apps on your iPhone, iPad or Apple Watch (beta): https://developer.apple.com/xcode/
Now everyone can get their app on their Apple device. Xcode 7 and
Swift now make it easier for everyone to build apps and run them
directly on their Apple devices. Simply sign in with your Apple ID,
and turn your idea into an app that you can touch on your iPad,
iPhone, or Apple Watch. Download Xcode 7 beta and try it yourself
today. Program membership is not required.
This isn't my own method, but I thought I'd help you out since I've just read this elsewhere:
Answer by WrightsCS
There's a way you can do this.
You will need ROOT access to edit the following file.
Navigation to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk and open the file SDKSettings.plist.
In that file, expand DefaultProperties and change CODE_SIGNING_REQUIRED to NO, while you are there, you can also change ENTITLEMENTS_REQUIRED to NO also.
You will have to restart Xcode for the changes to take effect. Also, you must do this for every .sdk you want to be able to run on device.
Now, in your project settings, you can change Code Signing Identity to Don't Code Sign.
Your app should now build and install on your device successfully."

Resources