Collecting Facebook data with a Share Share

0

Good afternoon! I'm doing my CBT and I need urgent help! Please!

Next ... I am making my app that at the end of the application the user can share, if you want through a shareDialog of the face ... until then it is quiet ... however I wanted it when the user clicked on share .. I could collect his data such as: name, surname, age, email and location .... Do I necessarily need to make a login? my code is below:

    public class CompartilharActivity extends AppCompatActivity {


private ShareDialog shareDialog;
private CallbackManager callbackManager;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_compartilhar);

    callbackManager = CallbackManager.Factory.create();



    shareDialog = new ShareDialog(this);  

}

public void shareLinks(View view) {

    Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.trofeu);
    if (ShareDialog.canShow(ShareLinkContent.class)) {
        ShareLinkContent content = new ShareLinkContent.Builder()
                .setContentTitle("Nome")
                .setContentDescription("Descricao")
                .setContentUrl(Uri.parse("http://site.com"))
                .build();


        shareDialog.show(content);
    }
}

What would be the best solution! Thank you!

    
asked by anonymous 26.11.2017 / 15:06

1 answer

0

You can only get these types of data if users allow this data to be released. For this you need to create a APP on facebook through the link: link and then create a permission request to the user.

See this example for SDK on PHP for facebook:

link

In this way a permission button is created where the user must accept what your application is asking for. If you decline, you can not get this data.

Here you have a list of permissions you can request:

link

    
26.11.2017 / 19:26