【问题标题】:Using share intent in Instagram. How to know is user actually shared or cancelled sharing activity?在 Instagram 中使用分享意图。如何知道用户实际分享或取消了分享活动?
【发布时间】:2018-05-17 06:47:23
【问题描述】:

下面是代码;

 Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
 shareIntent.setType("image/*");
 shareIntent.putExtra(Intent.EXTRA_STREAM,  Uri.parse("file://" + finalFile.getAbsolutePath()));
 shareIntent.setPackage("com.instagram.android");
 startActivityForResult(Intent.createChooser(shareIntent, "Share your Photo"),INSTA);

onActivityResult以下是不行的;

if (requestCode==INSTA)
    {
        if (resultCode == Activity.RESULT_OK) {
            // Here you do what you have to do.
            Toast.makeText(getApplicationContext(),"share successful...",Toast.LENGTH_LONG).show();
        }else 
        {
            Toast.makeText(getApplicationContext(),"share unsuccessful...",Toast.LENGTH_LONG).show();
        }

    }

【问题讨论】:

    标签: android instagram instagram-api


    【解决方案1】:

    你不能。

    如果您提供的代码不起作用,则意味着 Instagram 在分享图片后没有返回任何结果。但即使他们会返回结果(例如,RESULT_OK 这并不意味着图片实际上是共享的)。

    获取此信息的唯一方法是调用 instagram api 并检查用户是否在(例如 1-2 分钟)内发布了新照片,但我认为在不了解用户的情况下这是不可能的 :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-30
      相关资源
      最近更新 更多