How can i share image using pinterest sdk in android?

541 views Asked by At

I have installed Pinterest SDK using pinterst developer site in my android studio project and register app in developers account.I can't find out sources that can share the images in developer console.how can I share image just like facebook and twitter using sdk?

1

There are 1 answers

0
Foram Shah On

I have shared image using below code.

private void shareOnPinterest() {
        String sharingText = "Sharing Text";
        String imageUrl = "Image Url";
        String description = "Description";
        String url = String.format(
                "https://www.pinterest.com/pin/create/button/?url=%s&media=%s&description=%s",
                urlEncode(sharingText), urlEncode(imageUrl), description);
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
        filterByPackageName(getActivity(), intent, getString("com.pinterest"));
        startActivity(intent);


    } else {
        Utils.displayDialog(getActivity(), getResources().getString(R.string.error_somthing_went_wrong));
    }
}

Hope this will help you!