1

I am developing a free android app which will have in app purchases for upgrades. I would also like to implement a share button button, and give the user limited upgrades for sharing the app.

The code for the share button works, and the user can select to share from whatever comes up such a gmail, facebook, messages or whatever. The problem is, I know that the button got pressed, but I have no way of knowing whether the user actually shared with anyone.

I've searched the web and haven't found anything.

Maybe there is a third party solution for this or something?

    shareButton.setOnClickListener(new Button.OnClickListener() {
        @Override
        public void onClick(View v) {

            Intent shareintent = new Intent(android.content.Intent.ACTION_SEND); 
            shareintent.setType("text/plain");
            shareintent.putExtra(android.content.Intent.EXTRA_SUBJECT, "My app name");
            shareintent.putExtra(android.content.Intent.EXTRA_TEXT, "Here is the share content body");
            startActivity(Intent.createChooser(shareintent, "Share via"));
        }
    });
pigdog627
  • 123
  • 6
  • Does this answer your question? [How to confirm Android Share Intent is successful or complete](https://stackoverflow.com/questions/27241227/how-to-confirm-android-share-intent-is-successful-or-complete) – Martheen Mar 23 '20 at 11:37
  • @Martheen. Yes. That helps. I did a search before posting, but didn't find that for some reason. Thank you. – pigdog627 Mar 24 '20 at 21:40

1 Answers1

1

but I have no way of knowing whether the user actually shared with anyone

Correct. That is private between the user and the app they are using.

Also note that ACTION_SEND does not have to involve sharing anything with anyone. What ACTION_SEND does is up to the developer of the app responding to that Intent, and it does not have to share that content with other people. For example, it might simply add a to-do item for the user to a local database, and nothing more.

I've searched the web and haven't found anything.

That is because there is nothing with respect to ACTION_SEND.

If you directly integrate some SDK of select third-party apps, perhaps they will have a privacy-broken API that will tell you if the content was actually shared.

Maybe there is a third party solution for this or something?

Fortunately, in general, third parties have no means of hacking into other apps and somehow either forcing them to share content with other people or forcing them into reporting whether they have shared content with other people.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I wasn't wanting to hack into other apps or make use of broken privacy, just looking for honest verification, but thank you for your answer that it is not possible. – pigdog627 Mar 23 '20 at 21:16