Objective c 使用Facebook美味应用程序示例代码
我试图使用Facebook Scrumpious应用程序示例代码中的这段代码。我对“您的OG对象将由您的服务器托管URL”感到困惑。这是否意味着我必须在服务器上加载脚本?如果是,脚本是什么?另外,还有“repeater.php”文件。这是什么 是否有其他人必须对此进行配置,并且能够为我指出正确的方向?谢谢你的帮助Objective c 使用Facebook美味应用程序示例代码,objective-c,ios,facebook,facebook-graph-api,Objective C,Ios,Facebook,Facebook Graph Api,我试图使用Facebook Scrumpious应用程序示例代码中的这段代码。我对“您的OG对象将由您的服务器托管URL”感到困惑。这是否意味着我必须在服务器上加载脚本?如果是,脚本是什么?另外,还有“repeater.php”文件。这是什么 是否有其他人必须对此进行配置,并且能够为我指出正确的方向?谢谢你的帮助 - (id<SCOGMeal>)mealObjectForMeal:(NSString*)meal { // This URL is specific t
- (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;
}
-(id)mealObjectForMeal:(NSString*)餐
{
//此URL特定于此示例,可用于
//为此应用创建任意OG对象;您的OG对象
//将由您的服务器托管URL。
NSString*格式=
@"https:///repeater.php?"
@“fb:app_id=&og:type=%@&”
@“og:title=%@&og:description=%%22%@%%22&”
@“og:图像=https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png&"
@“正文=%@”;
//我们创建一个FBGraphObject对象,但我们可以将其视为
//具有类型化属性等的SCOGMeal。请参阅
//更多细节。
id结果=(id)[FBGraphObject graphObject];
//给它一个URL,它会回显食物的名称作为它的标题,
//描述,和正文。
result.url=[NSString stringWithFormat:format,
@“:餐”,餐,餐,餐];
返回结果;
}
请参见本教程中的。它包括一个示例脚本和对repeater.php
的引用。问题中的代码将在第7步的页面下方显示