share by

Currently displaying version

share: Native sharing menu for your app.

ios native share menu android native share menu

The forge.share namespace allows you to share content from your app via the iOS and Android native share menus.


forge.share.item(content, [targets], success, error)ΒΆ

iOS, Android

object an object containing the content to be shared
array an optional array of strings defining the built-in activity types to include in the share menu (iOS Only)
function() callback to be invoked when no errors occur
function(content) called with details of any error which may occur

content parameter

The content parameter can contain any combination of the following:

  • text: A string that will be shared.
  • subject: The string you would like to use as a subject for the share.
  • url: A string containint a URL.
  • image: A string containing a URL that points to the image you'd like to share.

Please note that only certain combinations may be supported depending on the platform and activity targets.

targets parameter

The targets parameter is only supported on iOS and allows you to define the subset of built-in activity types that will be displayed as targets in the share menu.

Valid values are:


Please note that this only applies to the built-in iOS apps. Any 3rd party apps that support sharing will still appear in the share menu.


Share an image with text and a URL

    image: "",
    text: "Trigger.IO is the simplest way to build amazing mobile apps",
    url: ""
}, function () {
    // success
}, function (error) {
    // handle any errors

Share a message and limit the built-in targets to

    subject: "",
    text: "Trigger.IO is the simplest way to build amazing mobile apps"
}, [ "Mail" ], function () {
    // success
}, function (error) {
    // handle any errors