I am trying to integrate Pinterest to my android application and to pin/share message with image.But I am not getting any way to do this. I downloaded the Pinterest SDK and added the jar file in my project.
Following is my code snnipet.
PinIt pinIt = new PinIt();
PinIt.setPartnerId("My ID");
pinIt.setUrl("http://placekitten.com/400/300");
pinIt.setImageUrl(m_cObjSocialTable.getPinterestImagePath());
pinIt.setDescription(pMessage);
pinIt.setListener(new PinItListener() {
@Override
public void onStart() {
super.onStart();
}
@Override
public void onComplete(boolean completed) {
super.onComplete(completed);
if (completed) {
System.out.println("Pinit complete");
}
}
@Override
public void onException(Exception e) {
super.onException(e);
System.out.println("Pinit Exception");
}
});
pinIt.doPinIt(this);
But it is not posting, in onComplete() we are getting false. Please help me on it
Thanks & Regards Tiru
IntentBuilder lIntentBuilder = ShareCompat.IntentBuilder.from(this);
Uri lPictureUri = null;
lPictureUri = Uri.fromFile(new File("mnt/sdcard/1.jpg"));
lIntentBuilder.setStream(lPictureUri);
String lType = null != lPictureUri ? "image/jpeg" : "text/plain";
lIntentBuilder.setType(lType);
lIntentBuilder.setText("My Description");
Intent shareIntent = lIntentBuilder.getIntent().setPackage("com.pinterest");
shareIntent.putExtra("com.pinterest.EXTRA_DESCRIPTION", "Messagessssssssss");
startActivity(shareIntent)
UPDATE: With the actual PinIt SDK, the setDescription method is working correctly.
Unfortunately, there is not way. I mean, it should work with setDescription() but is not. That seems to be a bug on the pinterest SDK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With