0

I created a game for iPad and I want to challenge my facebook friends.

I follow the iOS tutorial in "facebook dev docs", with the "Smash game", but it doesn't explain how to challenge a friend directly to a game.

I will explain with an example:

I want to start a new match and I want challenge a friend on facebook. Then I send him a request to install the app and when I detect that its app is installed I send him a request to play vs me.

Then, when I finish the match I sent him my result and my friend do the same thing. But if I and my friend don't finish the match it is not possible to send another challenge.

This scenario is not explained by facebook sdk. Is it necessary to use another instrument to do this situation?

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
cyclingIsBetter
  • 17,447
  • 50
  • 156
  • 241

1 Answers1

2

I suggest you look into Apple's GameKit API.

Why?

An iPad/iPhone owner is extremely likely to have linked his iPhone/iPad to his FB account.

How?

You will need to import the GameKit headers and link the GameKit library. You'll also need to enable GameKit in your iTunes Connect record.

What?

GameKit allows programmers to create achievements, leaderboards, and matches, which enables the "challenge" feature you wish for.

Any User Requirements?

Both people will need to have created a Game Center account and enabled your game to access it.

Any software/hardware requirement?

Apple has added Game Center in 2009, which means most devices now support it. Over 92% of devices run iOS6 or higher, as of March 2014, which makes devices running an older iOS irrelevant to most developers. There are a few differences in iOS7 regarding GK, but they probably do not matter to you.

Where to start?

I have two favorite sources of information, your mileage may vary. Mine are:

  1. Apple's Documentation
  2. Ray Wenderlich's amazing website. Actually, there even is a post on RW about GK, but it's a bit old (2011). It does have matchmaking in.

How about Facebook's SDK?

I never tried it. Apple has now integrated Facebook accounts in iOS, and I believe in simplifying my life as a programmer, as well as a user. However, if I were to do a feature to play "with my Facebook friends", and assuming the user's friend has an iPhone/iPad with FaceBook enabled, but hasn't got a GameKit account, I would then send him a FaceBook message to invite him to join me in game, where he can always join Game Center. Someone who doesn't want to join GameCenter is probably not really interested in playing a match anyway.

Kheldar
  • 5,361
  • 3
  • 34
  • 63
  • I understand, thankyou for the suggest; but for example "Ruzzle" (the famous words game) use only facebook account to play a match "one VS one"; is it possible with facebook sdk? – cyclingIsBetter Mar 18 '14 at 16:03