Question

In my android app I want user to send app link via whatsapp to his friends. I was able to send message but I have to store receiver's phone number too so that if his friend(receiver) installs the app the sender will be rewarded. Here is my code for sending whatsapp message :

    Intent waIntent = new Intent(Intent.ACTION_SEND);
    waIntent.setType("text/plain");
            String text = "link to app";
    waIntent.setPackage("com.whatsapp");
    if (waIntent != null) {
        //waIntent.
        waIntent.putExtra(Intent.EXTRA_TEXT, text);//
        startActivity(Intent.createChooser(waIntent, "Share with"));
    } else {
        Toast.makeText(this, "WhatsApp not Installed", Toast.LENGTH_SHORT)
                .show();
    }

When user is done with sending the message, I want to store the receiver's phone number. What should I do for that? Also if there is any other way of doing referral via whatsapp then do tell.

Était-ce utile?

La solution

Well ultimately the aim was to reward the user if his whatsapp referred friend installs the app which I finally did using Google Analytics Campaign Measurement.

Link for that How could I implement referral program for app users in Android market?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top