1
我必須將我的應用程序中的圖像分享到instagram。我已經通過Instagram開發者文檔,他們只提及通過Intent方法共享,但我需要的是我必須在發佈成功後得到回調。分享到Instagram並獲得回撥
private void createInstagramIntent(String type, String mediaPath){
// Create the new Intent using the 'Send' action.
Intent share = new Intent(Intent.ACTION_SEND);
// Set the MIME type
share.setType(type);
// Create the URI from the media
File media = new File(mediaPath);
Uri uri = Uri.fromFile(media);
// Add the URI to the Intent.
share.putExtra(Intent.EXTRA_STREAM, uri);
// Broadcast the Intent.
startActivity(Intent.createChooser(share, "Share to"));
}
有沒有辦法做到這一點?
@rekire ofcourse將得到一個回調startActivityForResult。但我們不能確定用戶是否共享。如果你按回退也startActivityForResult將被稱爲 – droidev
他們的API是安靜的基本:https://instagram.com/developer/mobile-sharing/android-intents/沒有更多的信息提供。 – rekire
那麼如果我沒有在手機上安裝Instagram,該怎麼辦? – droidev