lundi 25 juillet 2016

Facebook "Share" button is disabled when sharing photo in android app

I'm using the code below to share a photo on facebook. But the button is disabled. I have tried the code from this link and I was able to make it work. Here is my code:

Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.ic_information);
    SharePhoto photo = new SharePhoto.Builder()
            .setBitmap(image)
            .setCaption("Hello World!")
            .build();

    SharePhotoContent content = new SharePhotoContent.Builder()
            .setContentUrl(Uri.parse("https://developers.facebook.com"))
            .addPhoto(photo)
            .build();

    shareButton = (ShareButton) findViewById(R.id.buttonShare);
    shareButton.setShareContent(content);

Aucun commentaire:

Enregistrer un commentaire