From 027f0b8bb5efe9e87105034afce1ec5550e8c5c5 Mon Sep 17 00:00:00 2001 From: achorein Date: Thu, 18 Apr 2024 16:38:11 +0200 Subject: [PATCH] Update README.md --- README.md | 16 ++++++++-------- src/useShareIntent.tsx | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4ad65f7..64928d2 100644 --- a/README.md +++ b/README.md @@ -136,13 +136,13 @@ export default const App = () => { const { shareIntent } = useShareIntent(); ``` -| attribute | description | example | -|--------------------------|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------| -| `shareIntent.text` | raw text from text/weburl (ios) and text/\* (android) | "`some text`", "`http://example.com`", "`Hey, Click on my link : http://example.com/nickname`" | -| `shareIntent.webUrl` | link extracted from raw text | `null`, "`http://example.com`", "`http://example.com/nickname`" | -| `shareIntent.files` | image / movies / audio / files with name, path, mimetype and size (in octets) | `[{ path: "file:///local/path/filename", mimeType: "image/jpeg", fileName: "originalFilename.jpg", size: 2567402 }]` | -| `shareIntent.meta` | meta object which contains extra information about the share intent | `{ title: "My cool blog article" }` | -| `shareIntent.meta.title` | optional title property sent by other app. Currently only filled on Android | `My cool blog article` | +| attribute | description | example | +| ------------------------ | ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `shareIntent.text` | raw text from text/weburl (ios) and text/\* (android) | "`some text`", "`http://example.com`", "`Hey, Click on my link : http://example.com/nickname`" | +| `shareIntent.webUrl` | link extracted from raw text | `null`, "`http://example.com`", "`http://example.com/nickname`" | +| `shareIntent.files` | image / movies / audio / files with name, path, mimetype, size (in octets) and image dimension (width/height) | `[{ path: "file:///local/path/filename", mimeType: "image/jpeg", fileName: "originalFilename.jpg", size: 2567402, width: 800, height: 600 }]` | +| `shareIntent.meta` | meta object which contains extra information about the share intent | `{ title: "My cool blog article" }` | +| `shareIntent.meta.title` | optional title property sent by other app. Currently only filled on Android | `My cool blog article` | #### Customize Content Types in `app.json` @@ -166,7 +166,7 @@ Simply choose content types you need : ``` | Option | Values | -|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | iosActivationRules | Allow **text** sharing with `"NSExtensionActivationSupportsText": true`
**Url** sharing with `"NSExtensionActivationSupportsWebURLWithMaxCount": 1` and `"NSExtensionActivationSupportsWebPageWithMaxCount": 1`
**Images** sharing with `"NSExtensionActivationSupportsImageWithMaxCount": 1`
**Videos** sharing with `"NSExtensionActivationSupportsMovieWithMaxCount": 1`
**Files and audio** sharing with `"NSExtensionActivationSupportsFileWithMaxCount": 1`
_default value_: `{ "NSExtensionActivationSupportsWebURLWithMaxCount": 1, "NSExtensionActivationSupportsWebPageWithMaxCount": 1 }"`
_More info in apple developper doc [here](https://developer.apple.com/documentation/bundleresources/information_property_list/nsextension/nsextensionattributes/nsextensionactivationrule)_ | | androidIntentFilters | **one file sharing** array of MIME types :`"text/*"` / `"image/*"` / `"video/*"` / `"*/*"`
_default value_: `["text/*"]` (text and url) | | androidMultiIntentFilters | **multiple files sharing** array of MIME types : `"image/*"` / `"video/*"` / `"audio/*`/ `"*/*"`
_default value_: `[]` | diff --git a/src/useShareIntent.tsx b/src/useShareIntent.tsx index 45d4418..7efe59b 100644 --- a/src/useShareIntent.tsx +++ b/src/useShareIntent.tsx @@ -84,7 +84,7 @@ const parseShareIntent = (value, options): ShareIntent => { size: file.fileSize ? Number(file.fileSize) : null, }, ]; - }, [] as ShareIntentFile[]) + }, []) : null, type: isMedia ? "media" : "file", };