I am trying to share link with my android app with this:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, share);
intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "");
mContext.startActivity(intent);
this is the share Strong :
Check out my link:\n http://my123domain.com/v.php?vid=123456-123456-123456
But when i share it with Whats App the link is not click able,
Any idea Why?
Whatsapp does not allow sending clickable text links to people who do not have you in their contact list. Make sure receiving party have you in their contact list.
Related
When a user clicks a button in my app, it's supposed to launch an SMS app. To to this, I simply fired an intent.
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", "+234000000000", null));
intent.putExtra("sms_body", "Hello!"));
if (intent.resolveActivity(getActivity().getPackageManager()) != null) startActivity(intent);
This works perfectly fine! The only problem is that Facebook Messenger is among the list of apps that show up and I don't want that.
How can I filter this list and remove specific apps like Messenger?
Yes, you can restrict your app to open just android default messaging app.
Uri uri = Uri.parse("sms:+444498494984");
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
//android sms app package name
intent.setPackage("com.google.android.apps.messaging");
intent.putExtra("sms_body", "message to send");
if (intent.resolveActivity(getPackageManager()) != null)
{
startActivity(intent);
}
It is trying to give the user a choice on their favourite SMS app, Don't forget that Facebook Messenger can also manage SMS now that is why it is showing up as a choice. In my experience, Unless the user selects 'always' it can't be avoided. Imagine if the user has other apps to manage SMS we can't force them to use our preferred messaging app.
I know how to add a share button in android, but when I click on it I want the intent to store the link of the same app in playstore. However, I don't understand how to do this because I am trying to find the link of an app that hasn't been published yet.
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareBody = "Here is the share content body";
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject Here");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Add the app link here so that it is shown in playstore");
startActivity(Intent.createChooser(sharingIntent, "Share via"));
I know it can be achieved via Firebase Remote configurations, but is there any other way to do so.
you can do this by following:
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/apps/details?id=" + this.getPackageName())));
this is your link after publishing app: "http://play.google.com/store/apps/details?id=" + this.getPackageName()
I am unable to disable mailto and subject section when the intent comes on email section, but I need this two section fixed from my programming part. For an example
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto","abc#gmail.com", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
startActivity(Intent.createChooser(emailIntent, "Send email..."));
Here I want mail will be send only "abc#gmail.com" and user will not be able to edit this thing or not to put another email id. Same case for subject also.
Is this possible? Please suggest me.
I don't think that would be possible as you are just launching a third party application which your application have no control over. If you want to implement that feature in your app then you should use an SMTP library to send an email without user intervention.
This article might help you.
Try below code to send the email via intent in android device.
String data = "EMAIL MESSAGE";
Intent intentSendMail = new Intent(Intent.ACTION_SEND);
intentSendMail.setData(Uri.parse("mailto:"));
intentSendMail.setType("message/rfc822");
intentSendMail.putExtra(Intent.EXTRA_EMAIL, new String[] { "abc#gmail.com" });
intentSendMail.putExtra(Intent.EXTRA_SUBJECT, "Subject");
intentSendMail.putExtra(Intent.EXTRA_TEXT, "");
startActivity(Intent.createChooser(intentSendMail, "Send email..."));
NOTE:
This is only worked when you have installed at-least 1 mail client LIKE "EMAIL" or "GMAIL" in your device.
This will not worked in the simulator try with real device.
public void shareMessage(){
final Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, text);
getContext().startActivity(Intent.createChooser(intent, "Share"));
}
When I use "text/plain", Facebook comes up as an option but the text does not load up when selecting it. But the text does load for Twitter,email, SMS.
Has anyone else encountered this problem?
As mentioned in the comments , Facebook has disabled the share intent a few years back Android and Facebook share intent , it doesn't handle EXTRA_SUBJECT or EXTRA_TEXT fields,
Use the Facebook api , Instructions found here --> https://developers.facebook.com/docs/android/share#share_options
With this code i want to share an MP4 video to messaging apps like WhatsApp, Viber, Line etc. but only WhatsApp can do it successfully, But for Example if i choose Viber, After selecting recipient nothing happens, Screen flashes and nothing happens. how i can fix it?
Intent intent = new Intent(Intent.ACTION_SEND, Uri.parse(String.valueOf(path)));
intent.setDataAndType(Uri.parse(String.valueOf(path)), "video/*");
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(String.valueOf(path)));
context.startActivity(Intent.createChooser(intent, "Share video using"));