Ashwani Malik
Ashwani Malik

Reputation: 3

Facebook action does not specify any reference objects using android while publishing

My action is 'find'. Object is : 'valentine' . But in the property field my object's name is 'valentine_' of type 'Reference' .

Now, I am trying publish 'find' action using ANDROID which gives error message : "The action you're trying to publish is invalid because it does not specify any reference objects. At least one of the following properties must be specified : valentine_"

My Code :

private interface ValentineGraphObject extends GraphObject{
        public String getUrl();
        public void setUrl(String url);

         public String getId();
        public void setId(String id);
    }





    private interface FindAction extends OpenGraphAction{
        // The valentine object 
        public ValentineGraphObject getValentine();
        public void setValentine(ValentineGraphObject valentine_);
    }





    protected void populateOGAction(OpenGraphAction action) {
        FindAction findaction = action.cast(FindAction.class);
        ValentineGraphObject valentine_ =GraphObject.Factory.create(ValentineGraphObject.class);
        valentine_.setUrl("http://milliondollarsapps.com/Kunal/valen.html");
        findaction.setValentine(valentine_);
    }

Can some help me on this. Quick help would be appreciated. Thanks

Upvotes: 0

Views: 984

Answers (1)

Ming Li
Ming Li

Reputation: 15662

The problem here is you have a mismatch between the property on your FindAction interface (which is setValentine, and gets translated to just "valentine"), and the property in your OG action (which is "valentine_").

There are two ways to solve this:

a. Instead of using findaction.setValentine(...) do:

findaction.setProperty("valentine_", valentine_); 

b. Use the PropertyName annotation on your setValentine method:

private interface FindAction extends OpenGraphAction{
    // The valentine object 
    public ValentineGraphObject getValentine();
    @PropertyName("valentine_")
    public void setValentine(ValentineGraphObject valentine_);
}

Upvotes: 1

Related Questions