2012-09-11 3 views
1

페이스 북의 맛있는 앱 샘플 코드에서이 코드를 사용하려고합니다. 나는 당신의 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; 
} 

답변

2

자습서의 Step 2 - Set Up Your Backend Server을 참조하십시오. 여기에는 샘플 스크립트와 repeater.php에 대한 참조가 포함되어 있습니다. 질문의 코드가 7 단계에서 페이지 아래쪽에 나타납니다.

관련 문제