Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nativescript-community/ui-share-file

Package Overview
Dependencies
Maintainers
12
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nativescript-community/ui-share-file

Send/share file to other apps.

  • 1.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
46
decreased by-9.8%
Maintainers
12
Weekly downloads
 
Created
Source

Nativescript Share File

Send/Share files to other apps.

Android Intent, IOS InteractionController:

.

Installation

Install the plugin in your app.

npm install @nativescript-community/ui-share-file

Usage

Info: Shared files should be in the documents path.

    import { ShareFile } from '@nativescript-community/ui-share-file';
    import * as fs from '@nativescript/core/file-system';

    export class TestClass{

        shareFile;
        fileName;
        documents;
        path;
        file;

        constructor() {

            this.fileName = 'text.txt';
            this.documents = fs.knownFolders.documents();
            this.path = fs.path.join(this.documents.path, this.fileName);
            this.file = fs.File.fromPath(this.path);
            this.shareFile = new ShareFile();

            this.shareFile.open( { 
                path: this.path, 
                intentTitle: 'Open text file with:', // optional Android
                rect: { // optional iPad
                    x: 110,
                    y: 110,
                    width: 0,
                    height: 0
                },
                options: true, // optional iOS
                animated: true // optional iOS
            });
        }
    }

Arguments

path

Path to the file which will be shared.

String: Required

intentTitle

Title for the intent on Android.

String: (Optional) Default: Open file:.

rect

Positioning the view for iPads. On iPhones it's always shown on the bottom.

Object: (Optional) Default: {x: 0, y: 0, width: 0, height: 0 }.

options

Show additional opening options for iOS devices.

Boolean: (Optional) Default: false.

animated

Opening animation for iOS devices.

Boolean: (Optional) Default: false.

Keywords

FAQs

Package last updated on 03 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc