1

我正在尝试使用 Facebook Scrumptious 应用示例代码中的此代码。我对“您的 OG 对象将拥有由您的服务器托管的 URL”感到困惑。评论。这是否意味着我必须在服务器上加载脚本?如果是这样,什么脚本?此外,“repeater.php”文件。这是什么?

有没有其他人必须配置这个并且能够指出我正确的方向?谢谢你的帮助。

    - (id<SCOGMeal>)mealObjectForMeal:(NSString*)meal 
{
    // This URL is specific to this sample, and can be used to
    // create arbitrary OG objects for this app; your OG objects
    // will have URLs hosted by your server.
    NSString *format =  
        @"https://<YOUR_BACK_END>/repeater.php?"
        @"fb:app_id=<YOUR_APP_ID>&og:type=%@&"
        @"og:title=%@&og:description=%%22%@%%22&"
        @"og:image=https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png&"
        @"body=%@";

    // We create an FBGraphObject object, but we can treat it as 
    // an SCOGMeal with typed properties, etc. See <FacebookSDK/FBGraphObject.h> 
    // for more details.
    id<SCOGMeal> result = (id<SCOGMeal>)[FBGraphObject graphObject];

    // Give it a URL that will echo back the name of the meal as its title, 
    // description, and body.
    result.url = [NSString stringWithFormat:format, 
                   @"<YOUR_APP_NAMESPACE>:meal", meal, meal, meal];

    return result;
}
4

1 回答 1

2

请参阅教程中的步骤 2 - 设置后端服务器。它包括一个示例脚本和对repeater.php. 您问题的代码出现在第 7 步的页面下方。

于 2012-09-11T14:01:29.587 回答