I am integrating Facebook share functionality in my app. And I have already implemented how to share a custom story using share dialog. But every time I share something it shows me the preview dialog as given below.
What I intend to achieve is when I click on share button I want it to post automatically on my wall. I have given "publish_actions" and "publish_stream" permissions in my app scope.Do I need any special permission for this ?
I have seen this functionally in candy crush. While using Daily Booster Wheel after clicking on the 'Spread the word' button it doesn't pop up any share dialog but automatically share a custom story in user's wall and story looks like as below
Code I am using for custom story share
OpenGraphObject objProperty = OpenGraphObject.Factory.createForPost("namespace:level");
objProperty.setProperty("title","Title");
objProperty.setProperty("image","http://www.example.com/demo/image/wrong.jpg");
objProperty.setProperty("url", "http://www.example.com");
objProperty.setProperty("description", "Can you beat me?");
OpenGraphAction action = GraphObject.Factory.create(OpenGraphAction.class);
action.setProperty("level", objProperty); // here "level" is the object name
FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(FBActivity.this, action,"namespace:unlock","level").build();
uiHelper.trackPendingDialogCall(shareDialog.present());
It will helpful to me if somebody can provide some code snippet or any tutorial link for android as well as web app(JavaScript) to achieve above functionality.