Sharing¶
Non-Visible componentCategory | Requires | Version |
---|---|---|
Social | API 21, Android 5.0 Lollipop | 2 |
Overview¶
Sharing is a non-visible component that enables sharing files and/or messages between your app and other apps installed on a device. The component will display a list of the installed apps that can handle the information provided, and will allow the user to choose one to share the content with, for instance a mail app, a social network app, a texting app, and so on.
The file path can be taken directly from other components such as the Camera or the ImagePicker, but can also be specified directly to read from storage. Be aware that different devices treat storage differently, so a few things to try if, for instance, you have a file called arrow.gif in the folder Appinventor/assets
, would be:
"file:///sdcard/Appinventor/assets/arrow.gif"
or *"/storage/Appinventor/assets/arrow.gif"
Events¶
App Not Found¶
This event returns the social media name if an app is not installed. Possible names are 'Facebook Messenger', 'Facebook', 'Twitter', 'Telegram', 'Twitter', 'Snapchat', 'Google Plus' or the given custom package name.
Params | |
---|---|
name | Text |
Methods¶
Share File¶
Shares a file through any capable application installed on the phone by displaying a list of the available apps and allowing the user to choose one from the list. The selected app will open with the file inserted on it.
Params | |
---|---|
file | Text |
Share File With Message¶
Shares both a file and a message through any capable application installed on the phone by displaying a list of available apps and allowing the user to choose one from the list. The selected app will open with the file and message inserted on it.
Params | |
---|---|
file | Text |
message | Text |
Share Message¶
Shares a message through any capable application installed on the phone by displaying a list of the available apps and allowing the user to choose one from the list. The selected app will open with the message inserted on it.
Params | |
---|---|
message | Text |
Share Message To¶
Shares a message through the given app. If the given app is not installed, then the 'AppNotFound' event will be invoked and return the given name.
Params | |
---|---|
message | Text |
name | Text |
package Name | Text |
Share Message To Facebook¶
Shares a message through Facebook. If Facebook is not installed, then the 'AppNotFound' event will be invoked and return the name 'Facebook'.
Params | |
---|---|
message | Text |
Share Message To Facebook Messenger¶
Shares a message through Facebook Messenger. If Messenger is not installed, then the 'AppNotFound' event will be invoked and return the name 'Facebook Messenger'.
Params | |
---|---|
message | Text |
Share Message To Google+¶
Shares a message through Google Plus. If Google+ is not installed, then the 'AppNotFound' event will be invoked and return the name 'Google Plus'.
Params | |
---|---|
message | Text |
Share Message To Snapchat¶
Shares a message through Snapchat. If Snapchat is not installed, then the 'AppNotFound' event will be invoked and return the name 'Snapchat'.
Params | |
---|---|
message | Text |
Share Message To Telegram¶
Shares a message through Telegram. If Telegram is not installed, then the 'AppNotFound' event will be invoked and return the name 'Telegram'.
Params | |
---|---|
message | Text |
Share Message To Twitter¶
Shares a message through Twitter. If Twitter is not installed, then the 'AppNotFound' event will be invoked and return the name 'Twitter'.
Params | |
---|---|
message | Text |
Share Message To WhatsApp¶
Shares a message through WhatsApp. If WhatsApp is not installed, then the 'AppNotFound' event will be invoked and return the name 'WhatsApp'.
Params | |
---|---|
message | Text |
Properties¶
Share Dialog Message¶
Text Default: Send using... Write - Designer Blocks
Set the text for the sharing dialog. The default text is 'Send using...'.