5

I am trying to get Open Graph share actions to work on iOS. It's working some what, if I request the open graph url using the Open Graph Debugger first everything works as expected. However if I don't do this the preview in the share dialog is displayed for a seconds or so and then fades out. The post button is also disabled.

What I am seeing in the backend is that if I use the Open Graph Debugger or paste the object url into my own status I am getting requests from a Facebook server (69.171.234.117). However when I share directly from the application I am seeing a request from another Facebook server (173.252.74.115) this server doesn't seem to be able to read the Open Graph data correctly.

Has anyone seen anything like this before or know what's causing it?

EDIT: I've filed a bug with Facebook for this issue. Will updated here if it changes.

EDIT2: Facebook has confirmed this bug and is working on it. The suggested workaround for now is to trigger an initial scrape by using https://graph.facebook.com/?id={url}&scrape=true when the object is created.

EDIT3: Facebook closed the bug report and claimed the issue is solved in there latest SDK. I will verify this and report back.

EDIT4: This seems to be resolved now from my testing.

E. Bogren
  • 118
  • 1
  • 9
Hugo Tunius
  • 2,869
  • 24
  • 32
  • It would be really helpful if you can post your code to see how you're implementing the share dialog with Open Graph. When the preview disappears after a few seconds, it generally means that there's some fields or content on the share dialog that is not correctly formatted. – estemendoza Mar 17 '14 at 21:10
  • I unfortunately can't post any real code. However suffice to say that I am using `presentShareDialogWithOpenGraphActionParams:` and an Open Graph share action. The Open Graph Debugger is able to parse the open graph objects and reports no problems with it, wouldn't any problems be reported there? Also the symptoms with the different servers causing the problem vs not causing the problem seems highly unrelated to any client code imo – Hugo Tunius Mar 17 '14 at 22:32
  • I would try removing extra code added by you and start from scratch the part involving presentShareDialogWithOpenGraphActionParams. Maybe try the simplest code example located on the facebook developer page and once it's working fine, start from there – estemendoza Mar 17 '14 at 22:51

1 Answers1

2

I encountered this issue before, it turns out that instances of custom open graph objects that are hosted on your server are instantiated only when they are related to for the first time.

Only when the first edge in the FB graph is assigned to your object is it that it obtains an Identifier and it exists in FB's records.

This first edge can only be created using the FB app or the open graph application. After that's done you will be able to get a unique identifier for your object

GET https://graph.facebook.com/?ids=YOUR_OBJECT_URL

Then you could perform the share using the returned ID

Also see this SO post which supports my claim.

Community
  • 1
  • 1
Tom Susel
  • 3,397
  • 1
  • 24
  • 25
  • I've tried this some especially with the scrape option https://graph.facebook.com/?id=url&scrape=true I guess this action needs to be as soon as an object is created? – Hugo Tunius Mar 19 '14 at 14:51
  • According to what I read, yes - scrape will only work after there was instantiation at Facebook. A more appropriate name for this option would be 'rescrape' :) – Tom Susel Mar 20 '14 at 06:51
  • In that case is there something else I am missing about triggering a scrape from Facebook? As i stands right now while very helpful you answer doesn't really have a reason for the different behaviours coming from the different Facebook servers – Hugo Tunius Mar 20 '14 at 06:59
  • The answer to this is dependent on Facebook's architecture which we can only guess. One guess could be that the Open Graph Debugger is implemented on Facebook Server which has a more advanced version of code than the production servers which includes a bug fix. – Tom Susel Mar 20 '14 at 07:25
  • 1
    I think they have different servers which are used for different origins. This is a quote from the Facebook Support Staff "I have seen issues in the past where forcing a crawl using the Graph API before publishing the action allowed the action to be published without error, and that might be a good workaround, but we should try to fix the underlying problem." – Hugo Tunius Mar 20 '14 at 08:29