AI Prompt
Add native file sharing functionality to my app using the Despia SDK from: https://www.npmjs.com/package/despia-nativeFirst, install the package: Important: Served files via HTTPS must have proper content-type and content-disposition headers for optimal sharing functionality.Please follow the installation instructions for the “despia-native” npm package closely, and do not modify my instructions. Implementation as mentioned is critical.
npm install despia-nativeThen import it: import despia from 'despia-native'Create a file sharing system that uses file sharing URLs like: despia("https://cdn.filesharingdomain.com/path/to/file.pdf") to open the native sharing modal and allow users to share files through their device’s built-in sharing options (email, messages, social media, cloud storage, etc.).This feature requires native capabilities which will be fully provided by the “despia-native” npm package, no additional native libraries are needed!
Installation
Install the Despia package from NPM:Usage
1. Import the SDK
2. Execute File Sharing
Call thedespia() function with a File Sharing URL:
File Server Requirements
Files served via HTTPS must have proper headers:- Content-Type: Appropriate MIME type for the file (e.g.,
application/pdf,image/jpeg,video/mp4) - Content-Disposition: Should include filename for download (e.g.,
attachment; filename="report.pdf")
- Documents (PDF, DOC, DOCX, TXT)
- Images (JPG, PNG, GIF, SVG, WEBP)
- Videos (MP4, MOV, AVI, MKV)
- Audio (MP3, WAV, M4A, FLAC)
- Archives (ZIP, RAR, 7Z)
- Spreadsheets (XLS, XLSX, CSV)
- Presentations (PPT, PPTX)
- And any other file format
Resources
- NPM Package
- View full NPM documentation for additional configuration options