We have two iOS apps a Free version and Paid version. The only difference between these apps is that Free version as an IAP to fully unlock the content.
One of the modes in which the game can be played is multi-player over Game Center. The Auto-Matching and Invite Friends works perfectly fine when someone tries to match Free App vs Free App or Paid app vs Paid app.
The problem however is, it does not ever find a Auto-Match when a user from Free app is logged in and another player of paid app is logged in. This neither works in Sandbox nor in Production environments.
Other setup information:
Both these apps are in the same game center group
Both these apps have shared leader board and achievements (which is working fine)
Both these apps have Multiplayer Compatibility correctly setup with each other in iTunes Connect.
We had written to Apple Support about this problem but they came back saying Game Center is working fine and other setup in iTunesConnect also seems to be fine, they advised to check app code.
I have tried everything but nothing seems to be working. Here is the code we have in our app to do the Game Center matching
GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease];
request.minPlayers = 2;
request.maxPlayers = 2;
request.playersToInvite = nil; // This is not null only in case of friend invitations
GKMatchmakerViewController *mmvc =
[[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
mmvc.matchmakerDelegate = self;
[_presentingViewController presentViewController:mmvc animated:YES completion:nil];
Have also tried to set a value for playerGroup property of GKMatchRequest but didn't help
Questions:
Is there a missing link in the code we are using because of which the Auto-Match doesn't work?
Has anyone actually got this to work? If Yes, Could you please share some code samples and/or missing setup instructions?
This probably won't work. Game Groups are used to share Leaderboards but you can't create a match request to connect two different Apps. It even won't work with identcal apps, if the version information (version AND build) is not exactly the same. This is true for automatching but it also won't list online friends or nearby devices, that run a different version of the App.
I have found the answer to this problem. It has to do with the app prefix of the two apps. If they have a different app prefix, it will NOT work. You can change your old app prefix to match your new app prefix by contacting Apple https://developer.apple.com/contact/ .
You can read more here: https://developer.apple.com/library/ios/technotes/tn2311/_index.html Once Apple completes the prefix change for the old app, they will start working without any code changes or even resubmission of the apps.
Related
When trying to load rewarded ads I get the following error:
<Google> To get test ads on this device, set: GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = #[ #"a 32-character-string" ];
Loading test ads works, but when trying to show real ads, it says: Request Error: No ad to show.
Apple will not allow my App on the App Store, because the ads don't work.
I have not managed to fix this, since this article didn't help.
Adidionally, I have not used this in my code: .addTestDevice() and my Admob account is way older than 24 hours (it's possibly even many years old).
Is there a way to fix this?
depends, If you are using your own device or a simulator you cannot view your own adverts. you have to use a test ad id.
I also suspect that Apple was not holding your app because you did not follow one of their guidelines. You can find them on Apple's App Review page. If it is because the ads do not work, try the following:
remove the advertisements
upload to the app store
configure AdMob to use your AppStore id
update your app to include the advertisement later
This means there will not be a version of your app that breaks apple's placeholder content rule.
Apple also provides a test service called TestFlight and that may help you.
I'm having trouble with GKMatchMakerViewController on iOS 10 beta. I'm using 2 iPhone 5s's to build multiplayer functionality in my project. My issue is this. GKMatchMakerViewController comes up on both phones, but when the button titled "invite friends" is pressed to segue to a message invite one phone works and one phone does not. I have reloaded iOS 10 on the phone that it's not working for, I have made sure that it was connected to iCloud, I have checked my iCloud settings, my privacy settings, notifications settings, messages settings, game center settings, and I can find not difference in how the phones are set up.
My GKMatchmakerViewController was working before I updated to the beta version and according to the WWDC session about gameCenter (link below) and their new API there are no code changes required for GKMatchmakerViewController to work with Messages in iOS 10. So my only guess is that I have something blocking it from pulling up. I have not built in any thinking asking for permission to use the phones messages or contacts, but I didn't have to before and it said no code changes so I didn't spend any time on that.
Game Center WWDC 2016 link
I'm including a link to my code even though all I do is call GKMatchMakerViewController. Apple's API handles it from there and I only get a protocol when the message is accepted.
Link to code
I have implemented admob banners into many iOS apps, and never had this problem. Now, using the same sdk version, same code, and a variety of IDs that currently work in other app projects, this one project gives the following output and does not display a banner:
To get test ads on this device, call: request.testDevices = #[ GAD_SIMULATOR_ID ];
Why does it only happen in this Xcode project and how can I fix it? I'm not looking to find out how to enable testing mode. I want to get it to work just like all my other apps without testing mode.
Thanks!
It always displays that message. It i letting you know that if you want test ads to set the testing id. If you are not getting a banner then something else is occurring. Perhaps you have no ad fill or have misconfigured the ad.
I'm developing a turn-based iPhone game using Game Center. I created two Game Center accounts for testing but neither can find the other when I try to matchmake games. Both are in two matchmade games alone - neither found the other when matchmaking, in spite of the fact that the matches have 8 players max. What do you think could be causing this? Should I just put it on my physical device, because the games don't really work in sandbox, or what?
Gamecenter testing was a big disappointment for me, but I would enjoy to summarize some things that I learned in the process.
Make sure
-You enabled gamecenter support in both itunes connect's app information section and inside version details
-You completed a turn with a call to endTurnWithMatchData otherwise no other user will be able to connect to your game
-Know that simulator is able to connect to a game but it can't receive data only actual devices can.
-It is not a lag!
There is the possibility that your devices are actually able to match but there is a huge lag before they can, so you think it is not working. This happens to me with my iPad and iPhone for testing, it always takes around a minute to match another device. I have a asked a question regarding this lag here :Game Center Matchmaking GKTurnBasedMatch has significant lag (~1 min) Most replies told same things happens to them and problem is usually in apple's server not your code. I have also contacted apple for the issue by submitting a TSI, they have suggested doing many things (such as trying different gamecenter sandbox accounts, turning off the device, hard reset) but in the end all they told me was 1 min is well within the acceptable lag for turn based matchmaking. I have also submitted a bug report with ID #: 13635249 and its status is open.
I´m trying to develop a multiplayer App & I´m using GKMatchmaker for that.
Unfortunately its .inviteHandler is never fired, it just says "failed" in the game center invite dialogue. The app works with AUTO-MATCH though.
I did some testing & made sure that
2 seperate sandbox gamecenter accounts are logged in.
the test app runs on 2 devices (1 iPhone 4S & 1 iPad 2)
They still don´t connect.
I tried to start DOODLE JUMP (an existing iOS Game) und use the sandbox accounts for multiplay... they did not work either. Then i logged in with my REAL NON SANDBOX accounts to game center & THERE Doodlejump was working and the invitation was received successfully.
Do you have any ideas, how I could make my sandbox account work & receive my game center invitations?
Hope this still would be useful for someone...
Check two things in such situation:
You set inviteHandler just after the local player has authenticated.
The player you're trying to invite did allow game invites in their account settings. In case you had two test accounts, you could forget you disallowed it for both of them. In such case the push notification for invite won't even be sent to the other player.
As stated in the Apple GameKit Programming Guide, a signed distribution build app will use the live GC environment, while everything else will use the sandbox. Unless you have the Doodle Jump source and build a debug version to run on your devices it will not work in sandbox mode properly.
Also you should make sure you are calling your inviteHandler method as soon after you authenticated a user as possible.
If the above don't work, try restarting your devices. I created two test accounts and logged into two different devices with each respective account. I couldn't get invitations to work, though automatching was working fine. Restarting the devices somehow 'registered' them to get push notifications from Game Center, and invitations suddenly started working.