gpt4 book ai didi

objective-c - 使用 Facebook Scrumptious 应用示例代码

转载 作者:行者123 更新时间:2023-11-29 11:09:00 25 4
gpt4 key购买 nike

我正在尝试使用 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;
}

最佳答案

参见 Step 2 - Set Up Your Backend Server在教程中。它包括一个示例脚本和对 repeater.php 的引用。您问题中的代码显示在页面下方的第 7 步中。

关于objective-c - 使用 Facebook Scrumptious 应用示例代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12368901/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com