Question

I have an existing iOS app on the App Store that includes Game Center achievements. Since it also has a working Facebook Connect implementation, I'd like to leverage the social channels available through the new Achievements Graph APIs with my apps.

I have created the corresponding achievement pages ready to be registered with Facebook as achievements for my app. From what I have read, since the app auth token has to be used to submit achievements and scores, I'm doing all of this on my server using some PHP scripts so I don't have to ship my secret key with my app binaries. I'm planning to have my iOS app call a script on my server when submitting achievements or scores.

I am using the same FB app that I use for the native iOS app. Obviously I want it to start generating stories and timeline events when the user unlocks achievements or reaches a new high score.

However I am running into a big stumbling block when trying to register the achievements for the FB app. I get the following error with the script that does the registration :

OAuthException: (#15) This method is not supported for native apps

I seem to be doing everything right, sending a POST to the /<appid>/achievements API with the URL for the achievements, etc.

In an effort to work around limitations on these API by Facebook, I have also enabled the existing mobile app to also be a "Website" and "App on Facebook" in the developer settings. To no avail.

So my question is... am I missing something to enable achievements that could be submitted from an iOS app through an intermediary server? I don't mind setting up canvas pages and so on if necessary, but I'd rather not have the users re-authenticate as a wholly separate app just so they can post achievements and scores to their Facebook stream.

What I'm trying to achieve is at most ask the user for additional permissions on the existing app on their devices, if necessary. It should be possible to invoke a script on my server that will push the achievements to Facebook when needed - but how ?

Is the only way to do this to use a separate FB app that is not set as a native mobile app at all, or can it be a combination native/Web app?

Was it helpful?

Solution

It means you've probably configured your application on Facebook's side as 'Native/Desktop' instead of 'web'.

In this configuration your app secret is untrusted because it's assumed you've shipped it with the client code - there's no reason your IOS app won't work in 'web' mode, so use that instead

(I'm assuming you haven't actually shipped your app secret in client code - if you have, it's a huge security problem unless your app is set to 'Native/Desktop')

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top