og:type and domain restrictions on new User Actions?
So I'm trying to implement posting of actions into the timeline using the JavaScript SDK, and am curious about the following two errors:
Object at URL 'MYURL' is invalid because the configured 'og:type' of 'MYTYPE' is invalid.
Object at URL 'MYURL' of type 'snapapp_poll_dev:poll' is invalid because the domain 'MYDOMAIN' is not allowed for the application id 'MYAPPID' which owns the specified object type. If you are the owner of this application, you can verify your configured 'Site Domain' at LINKTOMYAPP.
Facebook seems to require that the og:type value EXACTLY matches value you put in the Graph API URL. e.g:
<meta开发者_如何转开发 property="og:type" content="APP_NAME:OBJECT_TYPE">
To post a user action about the above page, it would have to post to:
/me/APP_NAME:OBJECT_TYPE
Am I correct that these must match up exactly? Is there any case where they are allowed not to match, and/or the restrictions can be loosened?
Another thing I noticed is that the domain set on the connect app must match the URL used in the user action. Is this correct? And if so, is there any case where they are allowed not to match or to loosen the restriction?
Info on publishing user actions:
- https://developers.facebook.com/docs/beta/opengraph/actions/#create
- https://developers.facebook.com/docs/beta/opengraph/tutorial/#publish
The appname to object_type relationship is how Facebook determines what action to trigger on a user's account [timeline] so if they don't match there is an error as Facebook does not know what to do.
There shouldn't be any reason why you would have a problem with them matching but you can custom name objects as you see fit [your app name remains fixed to what you initially set and what others have not already taken].
The domain check exists to insure only you are posting actions under your own application. I'm not aware of any whitelist to add alternative domains but there very well could be.
Actually, the og:type and post url shouldn't match. You post to /me/APP_NAMEPACE:ACTION_TYPE
.
As the documentation states:
POST /me/{namespace}:{action-type-name}
https://developers.facebook.com/docs/beta/opengraph/actions/#create
精彩评论