Android Faker Sharing

The user must click on the message button in the sharing dialog box each time they fill the level. I need to eliminate these difficulties for the user. At the moment, I have created a user story and each time I request that the user click on the message.

Question:

  • I heard about FB friction mail for open graphic stories. Is this possible in android?

  • If the android has a message with a frictional message, could you please indicate the correction in my code that I inserted below.

  • If the android has a message with a friction message, what permission do I need from the user?

code

ShareOpenGraphObject object = new ShareOpenGraphObject.Builder() .putString("og:type", "puzzlegameballmania:level") .putString("og:title", "Cleared Level-1 !!!") .putString("og:image", "http://ixxxxwsz.jpg") .putString("og:url", "https://play.google.com/store/apps/details?id=com.gamxxxxx.android") .putString("og:description", "Color of the balls matters more. Lets break the goal and go higher !") .putString("puzzlegameballmania:level:title", "LEVEL 1") .build(); // Create an action ShareOpenGraphAction action = new ShareOpenGraphAction.Builder() .setActionType("puzzlegameballmania:clear") .putObject("puzzlegameballmania:level", object) .build(); // Create the content ShareOpenGraphContent content = new ShareOpenGraphContent.Builder() .setPreviewPropertyName("puzzlegameballmania:level") .setAction(action) .build(); ShareDialog.show(AndroidLauncher.this, content); 
+6
source share
1 answer
  • Yes
  • Do not use ShareDialog , use ShareDialog instead, here is a sample code
  • publish_actions permission is required and your application will be viewed by Facebook.

You can also read this Facebook developer post , which seems to prevent implicit / automatic posting. A warning is displayed to the user if the application has not been viewed.

Edit


Before using ShareApi , first check if the application has the required permission:

 private boolean hasPublishPermission() { AccessToken accessToken = AccessToken.getCurrentAccessToken(); return accessToken != null && accessToken.getPermissions().contains("publish_actions"); } 

If not, run the following code to request permission:

 LoginManager.getInstance().logInWithPublishPermissions( this, Arrays.asList("publish_actions")); 

If you use ShareApi without the appropriate permission, it will not be executed and the onError(FacebookException) method will be called if you passed FacebookCallback to ShareApi .

+1
source

All Articles