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

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.

Related

WatchOS app not detecting companion iOS app

I am making an independent Apple Watch app (but with a companion iPhone app which is not necessary for the watch app to function.)
The app uses WatchConnectivity to sync data between devices if iPhone companion app is installed. I am able to call session.updateApplicationContext() on the iOS app and receive session(didReceiveApplicationContext) on the Watch app. But going the other way is not possible. I always get an NSError code of 7018 which means the iOS companion app is not installed.
I have made sure both watchOS and iOS app are installed in simulator (and tested on my actual devices, iPhone 11 & Watch series 5.) But getting the same failed results from watchOS -> iOS.
I noticed there is a new WCSession instance variable available for watchOS 6.0+ isCompanionAppInstalled. When I read this variable after my WCSession is activated on my watch app, it always return false.
Is there anything else I need to look out for? I am thinking maybe there is something I did wrong in all the different info.plist. But I have checked them multiple times.
my info.plist files:
In my watch app:
WKWatchKitApp is YES
WKCompanionAppBundleIdentifier is com.abc.myapp
In my watch extension:
App can run independently of companion iPhone app is YES
NSExtension
WKAppBundleIdentifier is com.abc.myapp.watchkitapp
NSExtensionPointIdentifier is com.apple.watchkit
iOS app bundle identifier is com.abc.myapp
watchOS app is com.abc.myapp.watchkitapp
watchOS app extension is com.abc.myapp.watchkitapp.watchkitextension
Is there anything else I might be overlooking?
Thank you very much for any help/insight you can offer into this.
Ok. I found a way to get rid of the error and have the watch connectivity work from watch to iPhone.
Originally I wanted the watch app to be independent so in the watch extension target in Xcode, the check box "Supports Running Without iOS App Installation" is checked. But as soon as I uncheck this box, WCSession.isCompanionAppInstalled returns true and error goes away. Syncing from watch to iPhone starts working.
So hopefully this is not intended behavior and will soon be fixed by Apple. (I filed a bug report.) But for now, I am just going to leave the independent watchOS app unchecked because I do want WatchConnectivity in case iPhone app is installed by user.
Thank you for reading and good luck with your programming.
If you have "App is only available as a standalone watchOS app" in Info.plist, delete it even if it is false. Leave only "App can run independently of companion iPhone app". Also don't forget to set "WKCompanionAppBundleIdentifier" for Watch App (not extension). At least it works on real device for me with these parameters.
This seems to be a bug. Sometimes when I start my WatchOS app, it gets WCSession.isCompanionAppInstalled = false all the time, even though the companion app on the iPhone is running, and other apps are able to communicate with the phone.
This seems to go away when I force-restart the app on the watch (press side button, then swipe the app to the left and press the big red button, then start the app again). After the restart, everything seems to work fine.
This has happened only on Testflight builds so far. If it happens in production builds, I'm going to file a bug.
My iOS app will not launch in the Simulator if I uncheck "Supports Running Without iOS App Installation".

Any way to make React Native ios app for personal use?

I am making an ios app using React Native for the first time as a self learning exercise. I don't intend to launch it to the Apple App Store but it'd be nice to be able to use the app myself on my phone.
I've successfully deployed my app to my iPhone with "Release Build" settings, but after 3 days the app stops launching (with message "yourApp is no longer available"). I understand this is something to do with the provisioning profile expiring after x amount of days and a reinstall of the app from xcode is needed (from this thread)
Does anyone know any way to get around this? Or must I purchase a developer licence and go through deployment to the app store just to get my app working on my phone permanently? Thanks in advance!

Game Center authentication doesn't work in iOS 8

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"

"Cannot connect to iTunes store" when restoring iOS In App Purchase in iOS simulator

I've looked through the many existing questions related to "Cannot connect to iTunes store" issues with iOS StoreKit and I don't think my situation is covered:
When running in the iOS Simulator, I get the "Cannot connect to iTunes store" error after restoring a previous bought in app purchase. If I hit Cancel, the popup goes away and the restore is successful.
There is no problem at all when buying the in app purchase, only when restoring.
Also, the problem only occurs on the simulator, not when testing on a real iPhone.
I'm pretty sure everything is OK, just wanted to confirm that it is just a simulator bug. Any one else seen this one?
Having researched this as much as I can, and confirmed that there are no issues when running on a device, either in sandbox mode or (since yesterday, when the IAP was approved by Apple) using a real Apple ID, I'm assuming this is a simulator bug and can be ignored.
Contrary to the answer posted by iLive below, and repeated elsewhere on SO, testing IAP on the simulator is explicitly supported by Apple, except for hosted content downloads.
UPDATE: It would appear that since iOS 7, testing IAP on the simulator is no longer properly supported. I've had it working using the non-64bit simulator, but not with the 64bit iPhone simulator. Your milage may vary. As per pix's comment below, Apple also seem to have removed mention of iOS simulator testing from their documentation.
I do not believe you can test your purchases with the simulator.
From the "In-App Purchase Programming Guide":
Store Kit does not operate in iOS Simulator. When running your application in iOS Simulator, Store Kit logs a warning if your application attempts to retrieve the payment queue. Testing the store must be done on actual devices.
If you look at this link, Apple tells you about what you should do:
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/DevelopingwithStoreKit/DevelopingwithStoreKit.html
You can also check out this link: restore button for in-app purchases error
Hope this helped!
I ran into the same problem. I would get the "Cannot connect to iTunes Store". If you press Retry it will send you to the login prompt. However, if you press cancel, you will get "Restore Purchases Successful". This does seem limited to the simulator.
https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/index.html#//apple_ref/doc/uid/TP40001051-SW241
StoreKit (In-App purchases) will not work in the Simulator. 13962338
Make sure you use an account which is an sandbox user. I tried to use my personal iCloud account on Sandbox which got rejected with the same error.
As of recent (Version 8 and onwards) Xcode releases, I'd qualify the state of StoreKit in the simulator as partially implemented.
Apple officially says you need to test it on the device, however some calls seem to supported in the Simulator – at least the SKProductRequest always works flawlessly. Completing a purchase may or may not work.

In App purchase in iOS suddenly stop working ( Error code=5002 occurred )

I have integrated in-App purchase in my application successfully. I tested it properly by making test user account in itunes. My in-app purchase worked fine. But suddenly my IAP stopped working.
App can load all of the products but after entering my account credentials then transection queue undergoes state SKPaymentTransactionStateFailed and gives an error
Error Domain=SSServerErrorDomain Code=5002 "An unknown error has occurred"
It seems that the storekit does not work in the simulator any longer. I quote from storekit docs:
Note: Store Kit does not operate in iOS Simulator. When running your
application in iOS Simulator, Store Kit logs a warning if your
application attempts to retrieve the payment queue. Testing the store
must be done on actual devices.
Store Kit Docs
If you are testing on real device, make sure it is not JB.
If you are testing on simulator, make sure you are running iOS 6.0 or above, lower version of simulator doesn't work, I wasted a whole day to figure this out...
It has been stopped working on simulator. try to use it on real device. It will work fine.
I've run into the same error on iOS Simulator, but it works on my device(iPhone 3G).
The error is returned from Apple's Server, it's not under control by us.
Facing the same problem in ios 5.1 the store kit dosent work on simulator anymore you need to check it in the device.
And even after connecting to the device say you get an error code "Cannot connect to iTunes Store"
then that means that your device cannot contact the apple store and that is something which is not your fault.
To fix this, sign out of any existing account in the Settings app on your device.

Resources