Good evening,
I'm working on implementation game center to my iOS game and I want create achievements, which players will raise when they will rate app on the main board in game center and when they will like it on facebok using game center.
But I don't have any idea how to check it. Is possible, for example, catch events of those buttons (stars and like buttons) in game ceneter, or what way should I go?
I think if those buttons are in game center there should be some kind of cooperation with Objective-c.
Thank you.
I don't think there is a way to determine when an action is performed on either of those buttons in the Game Center view. Unfortunately, there is no solid way of determining when a user rates your app. As for determining if they have liked it on Facebook, you might want to try having them connect with Facebook and select a like button from within your app instead of from Game Center. Here is a link that may help with that: Like button in iOS application
Related
I'm creating an iOS swift app that will allow users to play sounds while in another app. The app is hard to explain, but I would like to know how to create some thing like the assistive touch or the zoom controllers. Like this: http://www.phonecruncher.com/siteimage/scale/0/0/368401.gif
It's hard to explain, but as you can see there is a button on the screen (it's always on top) and the user needs to be able to open a menu from the button. The user will play the sounds from here.
Is there any way I can do this in swift in Xcode?
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.
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.
When I'm trying to login to game center from my game a popup appears with use existing account/create account. If I tap create account a similar screen like the one from game center - create account appears. In that screen I'm not able to select the country. Every other button is working fine, I can drag and the Locations are moving, but I'm not able to select a country. In GameCenter application I can select a country(the screen seems to be the same). Did you encountered this problem? Do you know possible reasons for this problem?
Thanks!
EDIT1: I tested only on SANDBOX environment
EDIT2: I use to method_exchangeImplementations() to change: touchesBegan, touchesMoved, touchesEnded, touchesCancelled methods to custom functions, but I don't think this is the problem because drag works fine and tapping next button also works fine
This question may be a little vague / philosophical, but what do you do when a user doesn't want to use Game Center?
Normally you run authenticateWithCompletionHandler: when your app starts. But what if your user doesn't have a Game Center account? Do they then get nagged each launch?
After a little testing, it looks like the user is nagged only 3 times. After the third, they need to sign in via Game Center app. (I haven't seen any of this documented, hence the original question, and my uncertainty about the answer.)