Registering a new achievement: (#3502) Object at a

2020-07-23 06:10发布

问题:

I'm trying to add a new achievement for my game, when ever I try and test this on the Graph API Explorer, I get the following error:

(#3502) Object at achievement URL is not of type game.achievement.

I have followed this post(http://developers.facebook.com/blog/post/539/) to set up my achievement as such:

    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#"    xmlns:fb="http://www.facebook.com/2008/fbml">
    <head>
    <meta property="og:type" content="game.achievement"/>
    <meta property="og:url" content="FULL URL OF ACH. PAGE"/>
    <meta property="og:title" content="TEST"/>
    <meta property="og:description" content="This is a test"/>
    <meta property="og:image" content="IMG URL/>
    <meta property="game:points" content="1"/>
    <meta property="fb:app_id" content="APP_ID"/>
   </head>
   <body>
     Yay!
   </body>
   </html>

On the Graph API explorer, I set the method to POST, and add the fields: achievement, display order and access token, but this just produces the error mentioned above. I suspect I'm doing something wrong with the Achievement URL, which at the minute is set to something like: http://mypage.com/index/test.

回答1:

Test your achievement by entering the link to the achievement page here. It'll point out any errors that you have. Once you have all errors corrected, Facebook is SUPPOSED to register the achievement when you try again, especially since the debug tool, Linter, refreshes Facebook's cache. However, as of right now, I've been unsuccessful at getting Facebook to recognize my corrected achievement after it has already failed it. So, once I have my achievement perfect and verified by Linter, I rename my achievement file (and change the og:url property to match) then submit the registration again. This has worked 100% of the time for me.



回答2:

I had the same issue when working on localhost. I moved the pages to a website, verified with the URL Linter and just worked fine. Problem with URL Linter is that it does not work with localhost URLs.



回答3:

It is much easier to host the achievements within Facebook itself, rather than hosting them on 3rd party servers. Follow the instructions here to get familiar with the Object API. It's so much hassle free if you are doing mobile only apps IMO.