Disable invite banner - ios

When I invite a player to a turn based match in iOS Game-Center a Game Center banner is shown on top of the screen in the receiving side (at least most of the times, the functionality seems to be shaky).
I don't want a banner, but I want to handle that invite programmatically instead. Is that possible? The problem is that I can't control the banner. In some views I just want to ignore it.

Related

Is possible to access Game Center, directly from a custom keyboard extension?

I need to authenticate the user in Game Center from my custom keyboard, according to apple docs it should be done: "Via containing app, keyboard can participate in Game Center and In-App Purchase"
I can reach game center from my keyboard extension, but it complains that the bundle is not correct, because it add a d com.xxx.yyy.keyboard instead of com.xxx.yyy.
The only way to do the auth is in the containing app?
I don't think you can present Game Center Controller from a keyboard extension due to its restrictions.
Moreover, you have to be aware that Game Center will not be part of iOS 10 and will probably disappear soon. You will have to design your own interface using GameKit data.

Handle Selected Turns/Games in iOS Game Center App in Game Center Enabled App

I am creating a GKTurnBasedMatch Game Center-enabled app. I've successfully implemented GKLocalPlayerListener methods to listen for events, such as player:receivedTurnEventForMatch:didBecomeActive: and other methods. Additionally, if a user taps on an existing match in the GKTurnBasedMatchmakerViewController (for example, if showExistingMatches is set to YES), I can handle the event in the GKTurnBasedMatchmakerViewControllerDelegate method turnBasedMatchmakerViewController:didFindMatch:.
However, I want to handle tapping on the various controls to view a match within the iOS system Game Center app.
For example, if I navigate to the Game Center iOS pre-installed app (not my app), tap on the Turns tab, tap on the row for my app, tap on a match/turn, and then tap on "View Game" or "Accept Invite" or "Play your turn", I want to handle these match-specific actions in my app.
When these items are tapped, my app indeed launches, but as far as I can tell from reading the documentation, there is no way to get extra information about which match the user tapped, so I can appropriately show that match.
Apple has chosen to remove this feature.
Their documentation is inaccurate. I opened a bug with Apple to investigate further. Here is the disheartening proof.

Show ad after certain amount of interactions

I own a simple soundboard app, which basically plays a song when a button is pushed.
I wanted to know, if it was possible to show an ad after a certain amount of user interactions.
e.g when 20 sounds have been played, a fullscreen ad would pop-up.
I've integrated RevMob in to my app, if that makes any differences :)
Thanks!
As far as I know, with any ad provider (including RevMob), you have pretty decent control on when an ad should appear.
For RevMob, I see you can call "[[RevMobAds session] showFullscreen];" when you want to show a full screen ad (or RevMobAds.session().showFullscreen(); if you're using Swift -- you didn't specify).
So just add a counter property in your view controller and increment the number of user interactions you want to keep track of and then show the full screen ad when you're ready.

GameCenter Notifications Obtrusive to iAd view

I am displaying an iAd Banner at the top of my game and game center notifications are covering the iAd. Is there any GameKit framework delegate code that will let me know when a GameCenter banner is sliding onto my view so I can also slide my iAd down and then back up so the advertisement isn't covered.
No, there is no delegate method that notifies you when a Game Center banner will appear. Also keep in mind that what you're trying to do can disturb the user's game experience. I can tell you from personal experience that ads are pretty useless when users don't play your game regularly. 'Less is more' definitely applies to the implementation of mobile ads.
However, there are some methods/properties that can disable the game center banners. This gives you the opportunity to create your own custom Game Center UI. This information be found in Apple's Game Center Programming Guide: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html .
Keep in mind that this is no small undertaking. You'll have to handle all the Game Center features, like achievements and challenges, separately. But it's your best shot at handling the obtrusiveness of Game Center notifications.
If you don't want to write your own Game Center UI, consider placing your iAd banner at the bottom in parts where the notifications are most intrusive.

How to invite players through game centre app in iOS 7?

I've already implemented auto-matchmaking, and tested it between two actual devices with different game centre accounts, so I know I've setup that part correctly: I can create a match, and send data between both the players. Now I'm implementing the invitations part.
The Game Center programming guide
says:
The playersToInvite parameter is non-nil when your game is launched
directly from the Game Center app to host a match. This parameter
holds an array of player identifiers listing the players to invite
into the match.
What I don't understand, is how to invite players through the game centre app. In the game centre app, I can see my game. When I click on it, in the top right corner there is a button with text: "..." . When I click on it, I see two options: "Play" and "Share". Clicking on "Play" launches my app.
Is there some code I need to implement for the Game center app to present me with the option of selecting friends to invite etc?
EDIT: It appears that the person in this post has almost the same problem as me:
Definitive answer to what playersToInvite is for
But no definitive answer so far, on how that data gets populated.
There are actually a couple of problems, both of which are on apples end:
The documentation is not up to date. While it mentions to use [GKMatchMaker sharedMatchMaker].inviteHandler , it has actually been deprecated in iOS 7, but the documentation has not been updated to reflect this.
It appears that there is no way you can invite players from the Game Center app. The documentation is incorrect in this case - the game centre UI does not provide any way for selecting the players. You invite players using the matchmaking view controller provided by game center.
Instead of using GKMatchMaker.inviteHandler, one can implement GKLocalPlayerListener - but this hasn't been documented properly in the Game Center Programming guide. It is easy to implement as there are only two methods, and work in almost the same way as the deprecated handler.
EDIT: There is a way to invite players from the game center app, but currently there is a bug in iOS 7, so that the game center app's flow in production, does not match the flow in the sandbox. As a result, one must navigate a much more cryptic flow to find the option to invite a player through the game center app. Currently only one player can be invited through the game center app, even if your app supports more than two players.

Resources