Sending directly to a specific chat apps

print

You can do it with the following blocks:

Note that for the Data Uri you have to include the country code with out the + (i.e. Ireland = +353) followed by the rest of the mobile number.

A lot of people seem to have asked this question before, but they were trying to pass a piece of text to a specific contact in WhatsApp. As far as I can see, you can pass text to the contact picker or you can open a specific contact but I haven’t been able to do both. This means that the Extra Key and Extra Value blocks in the image above do not work.

If you’re interested in giving it a go yourself these links should get you started:
https://developer.android.com/reference/android/content/Intent.html109
http://app.thunkable.com/reference/components/connectivity.html#ActivityStarter79

Android DirectShare Sample

https://github.com/shadowmanpat/android-DirectShare

Sample demonstrating how to show some options directly in the list of share intent candidates.

Introduction

Direct Share is a feature that allows apps to show their internal options directly in the system Intent chooser dialog. This sample is a dummy messaging app, and just like any other messaging apps, it receives intents for sharing a plain text. When a user shares some text from some other app, this sample app will be listed as an option. Using the Direct Share feature, this app also shows some of contacts directly in the chooser dialog.

To enable Direct Share, apps need to implement a Service extending ChooserTargetService. Override the method onGetChooserTargets and return a list of Direct Share options.

In your AndroidManifest.xml, add a meta-data tag in your Activity that receives the Intent. Specify android:name as android.service.chooser.chooser_target_service, and point the android:value to the Service.

Pre-requisites

  • Android SDK 26
  • Android Build Tools v26.0.1
  • Android Support Repository

Screenshots

Screenshot Screenshot Screenshot

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.