Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7783409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:49:52+00:00 2026-06-01T19:49:52+00:00

I have created a Facebook Canvas App. This canvas app is essentially an image

  • 0

I have created a Facebook Canvas App. This canvas app is essentially an image library, the user is able to view images by clicking a ‘Next’ button – pretty simple.

I am using the Graph API to post to a custom object when a user has ‘looked at’ an image. I do this like so (PHP SDK):

$this->data['facebook']->api('/me/myapp:look_at', 'post', array(
        'picture' => current_url()
    ));

current_url() is the current URL of the Facebook canvas (https://apps.facebook.com/myapp/image/id). This page has a series of og meta tags:

   <meta property="og:title" content="<?=$image->title?>" />
   <meta property="og:description" content="Pic of <?=$image->title?>" />
   <meta property="og:image" content="https://www.***.com/***/images/<?=$image->src?>" />
   <meta property="fb:app_id" content="<?=FB_APP_ID?>" />
   <meta property="og:url" content="<?=current_url();?>" />
   <meta property="og:type" content="myapp:picture" />

I have read that when adding the image to the library I need to get Facebook to scrape the page for the og:tags. I do this using the following:

file_get_contents('https://graph.facebook.com?id=https://apps.facebook.com/myapp/image/'.url_title($_POST['title']).'/'.$data['image_id'].'&scrape=true');

However, I’m pretty certain that this isn’t working, after placing a mail() call in the app, visiting that URL and waiting nothing comes through, suggesting that it isn’t being scraped.

When running the first block of code (calling Graph API myapp:look_at) I get the following exception from Facebook:

Fatal error: Uncaught OAuthException: (#3502) Object at URL https://apps.facebook.com/myapp/image/img/id has og:type of 'website'. The property 'picture' requires an object of og:type 'myapp:picture'. thrown in /****/application/libraries/base_facebook.php on line 1106

If I use Facebook’s debugger tool to scrape the page I get all of the info. If I then revisit the canvas page where the FB Graph API call is made then everything goes through fine. I have read on other SO posts that this is a common problem, and I need to ask Facebook to scrape the page before calling the Graph API, which is precisely what I’m trying to do in the third block of code above (file_get_contents) without luck.

I guess my question would be: Am I going about this in the right way? I am struggling to find any clear documentation on the process when it is used in this way.

If I am going about it the right way, why is my page not being scraped when calling file_get_contents(‘https://app&#8230;.)?

Sorry for the long post, I’m trying to give you the full picture.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:49:54+00:00Added an answer on June 1, 2026 at 7:49 pm

    Fixed it. I needed a user-agent check on the code that posts the Graph API to prevent that from posting when FB hits it:

    if(strpos($_SERVER['HTTP_USER_AGENT'], 'facebookexternalhit') === false)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a new Facebook app. Whenever I visit the canvas page (https://apps.fac...)
I have created a facebook apps. Works fine for me. It contains canvas url,
I have created a Facebook app, added it to a Facebook Fan page and
I have created a Facebook App and a Facebook Page for a company. What
I have created a simple facebook login page at: http://bit.ly/Ims3U6 In the app settings:
I am really struggling with the facebook api. A have created a app, an
I have created a facebook application for App on Facebook and Website I am
We have created a facebook-app which contains a fb:comment field. We have included the
I have created a simple Facebook application in PHP, that greets user by there
I have created a facebook app that will be displayed on my companies fan

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.