How do I add GameCenter to my app? - ios

I need to save the high score to the user's GameCenter and also let the user compare his/her high score with others's using the leaderboard. How do I put this into my app - AppDelegate?

Official guides, tutorials and videos.
https://developer.apple.com/game-center/
Other good tutorials
http://code.tutsplus.com/tutorials/ios-sdk-game-center-achievements-and-leaderboards-part-1--mobile-5701
http://www.raywenderlich.com/3276/game-center-tutorial-for-ios-how-to-make-a-simple-multiplayer-game-part-12

Related

Implementing Achievements in iOS App without Game Center

Is there anyway possible to implement challenges and achievements in an app without using Game Center. The current app that I'm working on is not a game, but has challenges and achievements based on photo users submit. For example if a user uploads a photo of their pet, they get 50 points for submitting that picture.
You can use that, I create a simple class for iOS game center in GitHub
https://github.com/DaRkD0G/Easy-Game-Center-Swift
I would recommend having an if statement (or something like that) set up, and whenever the user "completes" the achievement, it changes a value on your server to "completed", and adds the number of points earned from the achievement to the user's overall points. If you already have a database storing user account data, you could add fields for the achievements. Then when the app loads the "achievements" page, you could just check the server real quick and display the results.

Facebook iOs Leaderboards

I would like to use the Facebook Scores API to make a social leaderboard for my iOS game.
From the documentation, I saw that it would require to request a publish permission so that I could post scores. The thing is that I don't want to publish to the player's wall (I simply think it's invasive), I just want to use the API backend to store the score, but everything I saw involved posting to the user's wall in order to write the score on the backend.
How should I proceed to only write the score without posting it into facebook?
If this thing exists, can I avoid requiring the publish permission?
Thanks
If you simply use the Score API as intended, the user will have the option of choosing whether to give your app the visibility permissions like "private, friends, public, etc". That lets the user decide what is invasive rather than you deciding for them.
Here is a related stackoverflow question with the opposite question, showing how users have control over what is shared with the API:
Facebook scores blocked by "only me" visibility

Facebook game Scores iOS

I'm making a new game right now where you can save your highscore, but I wobdered if I could implement a Facebook leaderboard. So the user could see their friend and see what their highscores are. Is this possible? Well, I saw this in different apps like Subway surfers from kiloo and 2048 from ketchapp. I didn't code anything because I don't how to do it. And I searched the facebook developer page and they said you have to do it with the graph API with scores or something. However, Hope you guys can help me out.
Best Regards.
Tom de Ruiter
There's the Facebook Scores API, the documentation is at this link
https://developers.facebook.com/docs/games/scores/
The downside is that Facebook will only store 1 score for a player, when you update it, you won't be able to see any previous scores (Of course, unless you set your own servers to do the job).
Also, there's no easy recipe to work with the Graph API, you just have to follow a few tutorials and you'll be in good shape to work with scores.

How to implement an ios app with facebook leaderboard?

I have a simple iOS app, which contain a score system.
I want to upload the score to Facebook leaderboard and compare with friends.
How can I do it?
I have no experience in this category.
So please help me.
More detail:
I have completed a simple ios game, which would save the best score got by player.
I want to create a leaderboard of the score on facebook,like game center.
so the score can be upload to the leaderboard shown on facebook.
Have a look here https://developers.facebook.com/docs/games/mobile/ios-tutorial/#opengraph for an introduction of the integration of iOS games and Facebook, and here https://developers.facebook.com/docs/games/scores for the explanation how to use the OpenGraph Scores API.
There is also an Achievements API which yoou could use: https://developers.facebook.com/docs/games/achievements/
As far as I know, results can only be queried for the User who gave the Access Token, respectively the User's friends. So, an overall leaderboard cannot be generated via these mechanisms.
Additional helpful links:
https://developers.facebook.com/docs/games/mobile/bestpractice
https://developers.facebook.com/docs/games/opengraph/
https://developers.facebook.com/docs/graph-api/reference/app/#scores

iOS Facebook SDK highscore story is not being displayed on user's timeline

I'm developing an iOS game and I want to post highscore stories into user's Facebook timeline.
I'm issuing a POST request to the scores api passing app access token and also the score. The method return true which, as stated in developers documentation, means that the score has been posted successfully.
The problem is that even that method seems to be working right, the highscore story never gets displayed on user's timeline. I'm aware that not all stories will be posted, but there wasn't even a single one I was able to see there. So it is not working.
The app is setup as a native iOS app under Games category.
Is there anything else I need to setup on app settings to get this working?
Thanks in advance.

Resources