expo-sharing 55.0.3 → 55.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +3 -1
- package/android/build.gradle +2 -2
- package/build/plugin/src/sharingPlugin.types.d.ts +85 -0
- package/build/plugin/src/sharingPlugin.types.d.ts.map +1 -0
- package/build/plugin/src/sharingPlugin.types.js +2 -0
- package/build/plugin/src/sharingPlugin.types.js.map +1 -0
- package/build/{Sharing.d.ts → src/Sharing.d.ts} +18 -0
- package/build/src/Sharing.d.ts.map +1 -0
- package/build/{Sharing.js → src/Sharing.js} +18 -0
- package/build/src/Sharing.js.map +1 -0
- package/build/src/Sharing.types.d.ts +165 -0
- package/build/src/Sharing.types.d.ts.map +1 -0
- package/build/src/Sharing.types.js.map +1 -0
- package/build/src/SharingNativeModule.d.ts.map +1 -0
- package/build/src/SharingNativeModule.js.map +1 -0
- package/build/src/SharingNativeModule.web.d.ts.map +1 -0
- package/build/src/SharingNativeModule.web.js.map +1 -0
- package/build/{index.d.ts → src/index.d.ts} +1 -0
- package/build/src/index.d.ts.map +1 -0
- package/build/src/index.js.map +1 -0
- package/build/src/useIncomingShare.d.ts +6 -0
- package/build/src/useIncomingShare.d.ts.map +1 -0
- package/build/{useIncomingShare.js → src/useIncomingShare.js} +2 -2
- package/build/src/useIncomingShare.js.map +1 -0
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3.module → 55.0.4/expo.modules.sharing-55.0.4.module} +7 -7
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.4/expo.modules.sharing-55.0.4.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.4/expo.modules.sharing-55.0.4.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.4/expo.modules.sharing-55.0.4.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.4/expo.modules.sharing-55.0.4.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3.pom → 55.0.4/expo.modules.sharing-55.0.4.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.4/expo.modules.sharing-55.0.4.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.4/expo.modules.sharing-55.0.4.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.4/expo.modules.sharing-55.0.4.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.4/expo.modules.sharing-55.0.4.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/maven-metadata.xml.sha512 +1 -1
- package/package.json +4 -4
- package/plugin/build/sharingPlugin.types.d.ts +44 -0
- package/plugin/src/sharingPlugin.types.ts +44 -0
- package/src/Sharing.ts +18 -0
- package/src/Sharing.types.ts +71 -13
- package/src/index.ts +2 -0
- package/src/useIncomingShare.ts +4 -4
- package/build/Sharing.d.ts.map +0 -1
- package/build/Sharing.js.map +0 -1
- package/build/Sharing.types.d.ts +0 -108
- package/build/Sharing.types.d.ts.map +0 -1
- package/build/Sharing.types.js.map +0 -1
- package/build/SharingNativeModule.d.ts.map +0 -1
- package/build/SharingNativeModule.js.map +0 -1
- package/build/SharingNativeModule.web.d.ts.map +0 -1
- package/build/SharingNativeModule.web.js.map +0 -1
- package/build/index.d.ts.map +0 -1
- package/build/index.js.map +0 -1
- package/build/useIncomingShare.d.ts +0 -14
- package/build/useIncomingShare.d.ts.map +0 -1
- package/build/useIncomingShare.js.map +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.3/expo.modules.sharing-55.0.3.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.3/expo.modules.sharing-55.0.3.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.3/expo.modules.sharing-55.0.3.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.3/expo.modules.sharing-55.0.3.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.3/expo.modules.sharing-55.0.3.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.3/expo.modules.sharing-55.0.3.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.3/expo.modules.sharing-55.0.3.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sharing/55.0.3/expo.modules.sharing-55.0.3.pom.sha512 +0 -1
- /package/build/{Sharing.types.js → src/Sharing.types.js} +0 -0
- /package/build/{SharingNativeModule.d.ts → src/SharingNativeModule.d.ts} +0 -0
- /package/build/{SharingNativeModule.js → src/SharingNativeModule.js} +0 -0
- /package/build/{SharingNativeModule.web.d.ts → src/SharingNativeModule.web.d.ts} +0 -0
- /package/build/{SharingNativeModule.web.js → src/SharingNativeModule.web.js} +0 -0
- /package/build/{index.js → src/index.js} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3-sources.jar → 55.0.4/expo.modules.sharing-55.0.4-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3-sources.jar.md5 → 55.0.4/expo.modules.sharing-55.0.4-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3-sources.jar.sha1 → 55.0.4/expo.modules.sharing-55.0.4-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3-sources.jar.sha256 → 55.0.4/expo.modules.sharing-55.0.4-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3-sources.jar.sha512 → 55.0.4/expo.modules.sharing-55.0.4-sources.jar.sha512} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3.aar → 55.0.4/expo.modules.sharing-55.0.4.aar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3.aar.md5 → 55.0.4/expo.modules.sharing-55.0.4.aar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3.aar.sha1 → 55.0.4/expo.modules.sharing-55.0.4.aar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3.aar.sha256 → 55.0.4/expo.modules.sharing-55.0.4.aar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.sharing/{55.0.3/expo.modules.sharing-55.0.3.aar.sha512 → 55.0.4/expo.modules.sharing-55.0.4.aar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</a>
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
|
-
Provides a way to share files directly with other compatible applications.
|
|
10
|
+
Provides a way to share files directly with other compatible applications and to receive compatible data shared from other apps.
|
|
11
11
|
|
|
12
12
|
# API documentation
|
|
13
13
|
|
|
@@ -20,6 +20,8 @@ For [managed](https://docs.expo.dev/archive/managed-vs-bare/) Expo projects, ple
|
|
|
20
20
|
|
|
21
21
|
# Installation in bare React Native projects
|
|
22
22
|
|
|
23
|
+
***Sharing content into your app is not supported in bare React Native projects.***
|
|
24
|
+
|
|
23
25
|
For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
|
|
24
26
|
|
|
25
27
|
### Add the package to your npm dependencies
|
package/android/build.gradle
CHANGED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export type SingleShareAction = 'android.intent.action.SEND';
|
|
2
|
+
export type MultiShareAction = 'android.intent.action.SEND_MULTIPLE';
|
|
3
|
+
export type ShareAction = SingleShareAction | MultiShareAction;
|
|
4
|
+
export type IntentFilter = {
|
|
5
|
+
action: ShareAction;
|
|
6
|
+
category: 'android.intent.category.DEFAULT';
|
|
7
|
+
filters: string[];
|
|
8
|
+
data: {
|
|
9
|
+
mimeType: string;
|
|
10
|
+
}[];
|
|
11
|
+
};
|
|
12
|
+
export type SingleIntentFilter = IntentFilter & {
|
|
13
|
+
action: SingleShareAction;
|
|
14
|
+
};
|
|
15
|
+
export type MultiIntentFilter = IntentFilter & {
|
|
16
|
+
action: MultiShareAction;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Describes a configuration for data types that are possible to share in the application on iOS.
|
|
20
|
+
*
|
|
21
|
+
* @platform ios */
|
|
22
|
+
export type ActivationRuleOptions = {
|
|
23
|
+
/**
|
|
24
|
+
* Whether the app should accept shared text.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
supportsText?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Determines a maximum number of web URLs that can be shared with the app.
|
|
30
|
+
* When `0` the app will not accept web URL shares.
|
|
31
|
+
*
|
|
32
|
+
* @default 0
|
|
33
|
+
*/
|
|
34
|
+
supportsWebUrlWithMaxCount?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Determines a maximum number of images that can be shared with the app.
|
|
37
|
+
* When `0` the app will not accept shared images.
|
|
38
|
+
*
|
|
39
|
+
* @default 0
|
|
40
|
+
*/
|
|
41
|
+
supportsImageWithMaxCount?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Determines a maximum number of videos that can be shared with the app.
|
|
44
|
+
* When `0` the app will not accept video shares.
|
|
45
|
+
*
|
|
46
|
+
* @default 0
|
|
47
|
+
*/
|
|
48
|
+
supportsMovieWithMaxCount?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Determines a maximum number of files that can be shared with the app.
|
|
51
|
+
* When `0` the app will not accept file shares.
|
|
52
|
+
*
|
|
53
|
+
* @default 0
|
|
54
|
+
*/
|
|
55
|
+
supportsFileWithMaxCount?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Determines a maximum number of webpages that can be shared with the app.
|
|
58
|
+
* When `0` the app will not accept webpage shares.
|
|
59
|
+
*
|
|
60
|
+
* @default 0
|
|
61
|
+
*/
|
|
62
|
+
supportsWebPageWithMaxCount?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Determines a maximum number of attachments that can be shared with the app.
|
|
65
|
+
* When `0` the app will not accept attachment shares.
|
|
66
|
+
*
|
|
67
|
+
* @default 0
|
|
68
|
+
*/
|
|
69
|
+
supportsAttachmentsWithMaxCount?: number;
|
|
70
|
+
};
|
|
71
|
+
export type ActivationRule = ActivationRuleOptions | string;
|
|
72
|
+
export type ShareExtensionConfigPluginProps = {
|
|
73
|
+
ios?: {
|
|
74
|
+
enabled?: boolean;
|
|
75
|
+
extensionBundleIdentifier?: string;
|
|
76
|
+
appGroupId?: string;
|
|
77
|
+
activationRule?: ActivationRule;
|
|
78
|
+
};
|
|
79
|
+
android?: {
|
|
80
|
+
enabled?: boolean;
|
|
81
|
+
singleShareMimeTypes?: string[];
|
|
82
|
+
multipleShareMimeTypes?: string[];
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=sharingPlugin.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharingPlugin.types.d.ts","sourceRoot":"","sources":["../../../plugin/src/sharingPlugin.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,4BAA4B,CAAC;AAC7D,MAAM,MAAM,gBAAgB,GAAG,qCAAqC,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,iCAAiC,CAAC;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;KAClB,EAAE,CAAC;CACL,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG;IAC9C,MAAM,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAC7C,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF;;;mBAGmB;AACnB,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;;;;OAKG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC;CAC1C,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,qBAAqB,GAAG,MAAM,CAAC;AAE5D,MAAM,MAAM,+BAA+B,GAAG;IAC5C,GAAG,CAAC,EAAE;QACJ,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,yBAAyB,CAAC,EAAE,MAAM,CAAC;QACnC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,cAAc,CAAC,EAAE,cAAc,CAAC;KACjC,CAAC;IACF,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;QAChC,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;KACnC,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharingPlugin.types.js","sourceRoot":"","sources":["../../../plugin/src/sharingPlugin.types.ts"],"names":[],"mappings":"","sourcesContent":["export type SingleShareAction = 'android.intent.action.SEND';\nexport type MultiShareAction = 'android.intent.action.SEND_MULTIPLE';\nexport type ShareAction = SingleShareAction | MultiShareAction;\nexport type IntentFilter = {\n action: ShareAction;\n category: 'android.intent.category.DEFAULT';\n filters: string[];\n data: {\n mimeType: string;\n }[];\n};\nexport type SingleIntentFilter = IntentFilter & {\n action: SingleShareAction;\n};\n\nexport type MultiIntentFilter = IntentFilter & {\n action: MultiShareAction;\n};\n\n/**\n * Describes a configuration for data types that are possible to share in the application on iOS.\n *\n * @platform ios */\nexport type ActivationRuleOptions = {\n /**\n * Whether the app should accept shared text.\n * @default false\n */\n supportsText?: boolean;\n /**\n * Determines a maximum number of web URLs that can be shared with the app.\n * When `0` the app will not accept web URL shares.\n *\n * @default 0\n */\n supportsWebUrlWithMaxCount?: number;\n /**\n * Determines a maximum number of images that can be shared with the app.\n * When `0` the app will not accept shared images.\n *\n * @default 0\n */\n supportsImageWithMaxCount?: number;\n /**\n * Determines a maximum number of videos that can be shared with the app.\n * When `0` the app will not accept video shares.\n *\n * @default 0\n */\n supportsMovieWithMaxCount?: number;\n /**\n * Determines a maximum number of files that can be shared with the app.\n * When `0` the app will not accept file shares.\n *\n * @default 0\n */\n supportsFileWithMaxCount?: number;\n /**\n * Determines a maximum number of webpages that can be shared with the app.\n * When `0` the app will not accept webpage shares.\n *\n * @default 0\n */\n supportsWebPageWithMaxCount?: number;\n /**\n * Determines a maximum number of attachments that can be shared with the app.\n * When `0` the app will not accept attachment shares.\n *\n * @default 0\n */\n supportsAttachmentsWithMaxCount?: number;\n};\nexport type ActivationRule = ActivationRuleOptions | string;\n\nexport type ShareExtensionConfigPluginProps = {\n ios?: {\n enabled?: boolean;\n extensionBundleIdentifier?: string;\n appGroupId?: string;\n activationRule?: ActivationRule;\n };\n android?: {\n enabled?: boolean;\n singleShareMimeTypes?: string[];\n multipleShareMimeTypes?: string[];\n };\n};\n"]}
|
|
@@ -10,7 +10,25 @@ export declare function isAvailableAsync(): Promise<boolean>;
|
|
|
10
10
|
* @param options A map of share options.
|
|
11
11
|
*/
|
|
12
12
|
export declare function shareAsync(url: string, options?: SharingOptions): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns raw data shared with the app. Returns an empty array if no data has been shared with the app.
|
|
15
|
+
*
|
|
16
|
+
* @platform android
|
|
17
|
+
* @platform ios
|
|
18
|
+
* @experimental
|
|
19
|
+
*/
|
|
13
20
|
export declare function getSharedPayloads(): SharePayload[];
|
|
21
|
+
/**
|
|
22
|
+
* Returns resolved data shared with the app. Compared to data returned from [`getSharedPayloads`](#sharinggetsharedpayloads) contains additional
|
|
23
|
+
* information useful for reading and displaying the data. For example, when a web `URL` is shared with the app,
|
|
24
|
+
* a resolved payload will contain additional information about the URL contents.
|
|
25
|
+
*
|
|
26
|
+
* > Depending on what has been shared, this method may require a network connection to resolve content details.
|
|
27
|
+
*
|
|
28
|
+
* @platform android
|
|
29
|
+
* @platform ios
|
|
30
|
+
* @experimental
|
|
31
|
+
*/
|
|
14
32
|
export declare function getResolvedSharedPayloadsAsync(): Promise<ResolvedSharePayload[]>;
|
|
15
33
|
/**
|
|
16
34
|
* Clears the data shared with the app.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sharing.d.ts","sourceRoot":"","sources":["../../src/Sharing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIrF;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CASzD;AAGD;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKzF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,YAAY,EAAE,CAElD;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,8BAA8B,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAEtF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
|
|
@@ -26,9 +26,27 @@ export async function shareAsync(url, options = {}) {
|
|
|
26
26
|
}
|
|
27
27
|
return await SharingNativeModule.shareAsync(url, options);
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns raw data shared with the app. Returns an empty array if no data has been shared with the app.
|
|
31
|
+
*
|
|
32
|
+
* @platform android
|
|
33
|
+
* @platform ios
|
|
34
|
+
* @experimental
|
|
35
|
+
*/
|
|
29
36
|
export function getSharedPayloads() {
|
|
30
37
|
return SharingNativeModule.getSharedPayloads();
|
|
31
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Returns resolved data shared with the app. Compared to data returned from [`getSharedPayloads`](#sharinggetsharedpayloads) contains additional
|
|
41
|
+
* information useful for reading and displaying the data. For example, when a web `URL` is shared with the app,
|
|
42
|
+
* a resolved payload will contain additional information about the URL contents.
|
|
43
|
+
*
|
|
44
|
+
* > Depending on what has been shared, this method may require a network connection to resolve content details.
|
|
45
|
+
*
|
|
46
|
+
* @platform android
|
|
47
|
+
* @platform ios
|
|
48
|
+
* @experimental
|
|
49
|
+
*/
|
|
32
50
|
export async function getResolvedSharedPayloadsAsync() {
|
|
33
51
|
return await SharingNativeModule.getResolvedSharedPayloadsAsync();
|
|
34
52
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sharing.js","sourceRoot":"","sources":["../../src/Sharing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,mBAAmB,EAAE,CAAC;QACxB,IAAI,mBAAmB,CAAC,gBAAgB,EAAE,CAAC;YACzC,OAAO,MAAM,mBAAmB,CAAC,gBAAgB,EAAE,CAAC;QACtD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,UAA0B,EAAE;IACxE,IAAI,CAAC,mBAAmB,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,CAAC;QAC5D,MAAM,IAAI,mBAAmB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,MAAM,mBAAmB,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,mBAAmB,CAAC,iBAAiB,EAAE,CAAC;AACjD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B;IAClD,OAAO,MAAM,mBAAmB,CAAC,8BAA8B,EAAE,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,mBAAmB,CAAC,mBAAmB,EAAE,CAAC;AAC5C,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport { ResolvedSharePayload, SharePayload, SharingOptions } from './Sharing.types';\nimport SharingNativeModule from './SharingNativeModule';\n\n// @needsAudit\n/**\n * Determine if the sharing API can be used in this app.\n * @return A promise that fulfills with `true` if the sharing API can be used, and `false` otherwise.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n if (SharingNativeModule) {\n if (SharingNativeModule.isAvailableAsync) {\n return await SharingNativeModule.isAvailableAsync();\n }\n return true;\n }\n\n return false;\n}\n\n// @needsAudit\n/**\n * Opens action sheet to share file to different applications which can handle this type of file.\n * @param url Local file URL to share.\n * @param options A map of share options.\n */\nexport async function shareAsync(url: string, options: SharingOptions = {}): Promise<void> {\n if (!SharingNativeModule || !SharingNativeModule.shareAsync) {\n throw new UnavailabilityError('Sharing', 'shareAsync');\n }\n return await SharingNativeModule.shareAsync(url, options);\n}\n\n/**\n * Returns raw data shared with the app. Returns an empty array if no data has been shared with the app.\n *\n * @platform android\n * @platform ios\n * @experimental\n */\nexport function getSharedPayloads(): SharePayload[] {\n return SharingNativeModule.getSharedPayloads();\n}\n\n/**\n * Returns resolved data shared with the app. Compared to data returned from [`getSharedPayloads`](#sharinggetsharedpayloads) contains additional\n * information useful for reading and displaying the data. For example, when a web `URL` is shared with the app,\n * a resolved payload will contain additional information about the URL contents.\n *\n * > Depending on what has been shared, this method may require a network connection to resolve content details.\n *\n * @platform android\n * @platform ios\n * @experimental\n */\nexport async function getResolvedSharedPayloadsAsync(): Promise<ResolvedSharePayload[]> {\n return await SharingNativeModule.getResolvedSharedPayloadsAsync();\n}\n\n/**\n * Clears the data shared with the app.\n */\nexport function clearSharedPayloads(): void {\n SharingNativeModule.clearSharedPayloads();\n}\n"]}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export type SharingOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* Sets `mimeType` for `Intent`.
|
|
4
|
+
* @platform android
|
|
5
|
+
*/
|
|
6
|
+
mimeType?: string;
|
|
7
|
+
/**
|
|
8
|
+
* [Uniform Type Identifier](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html)
|
|
9
|
+
* - the type of the target file.
|
|
10
|
+
* @platform ios
|
|
11
|
+
*/
|
|
12
|
+
UTI?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Sets share dialog title.
|
|
15
|
+
* @platform android
|
|
16
|
+
* @platform web
|
|
17
|
+
*/
|
|
18
|
+
dialogTitle?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Sets the anchor point for iPad
|
|
21
|
+
* @platform ios
|
|
22
|
+
*/
|
|
23
|
+
anchor?: {
|
|
24
|
+
x?: number;
|
|
25
|
+
y?: number;
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Determines the type of content being shared.
|
|
32
|
+
* - `text`: Plain text content.
|
|
33
|
+
* - `url`: A specific URL.
|
|
34
|
+
* - `audio`: An audio file.
|
|
35
|
+
* - `image`: An image file.
|
|
36
|
+
* - `video`: A video file.
|
|
37
|
+
* - `file`: A generic file.
|
|
38
|
+
*
|
|
39
|
+
* @platform android
|
|
40
|
+
* @platform ios
|
|
41
|
+
* @experimental
|
|
42
|
+
*/
|
|
43
|
+
export type ShareType = 'text' | 'url' | 'audio' | 'image' | 'video' | 'file';
|
|
44
|
+
/**
|
|
45
|
+
* Describes the resolved content type.
|
|
46
|
+
*
|
|
47
|
+
* @platform android
|
|
48
|
+
* @platform ios
|
|
49
|
+
* @experimental
|
|
50
|
+
*/
|
|
51
|
+
export type ContentType = 'text' | 'audio' | 'image' | 'video' | 'file' | 'website';
|
|
52
|
+
/**
|
|
53
|
+
* Represents raw data shared with the app.
|
|
54
|
+
*
|
|
55
|
+
* @platform android
|
|
56
|
+
* @platform ios
|
|
57
|
+
* @experimental
|
|
58
|
+
*/
|
|
59
|
+
export type SharePayload = {
|
|
60
|
+
/**
|
|
61
|
+
* The primary value of the content.
|
|
62
|
+
* - For `text`, this is the message body.
|
|
63
|
+
* - For `url`, this is the URL string.
|
|
64
|
+
* - For `file`, `image`, `video`, or `audio`, this is typically the file URI.
|
|
65
|
+
*
|
|
66
|
+
* @default ""
|
|
67
|
+
*/
|
|
68
|
+
value: string;
|
|
69
|
+
/**
|
|
70
|
+
* The type of the shared content.
|
|
71
|
+
* @default 'text'
|
|
72
|
+
*/
|
|
73
|
+
shareType: ShareType;
|
|
74
|
+
/**
|
|
75
|
+
* The MIME type of the contents of the`value` field.
|
|
76
|
+
*
|
|
77
|
+
* @default 'text/plain'
|
|
78
|
+
*/
|
|
79
|
+
mimeType?: string;
|
|
80
|
+
};
|
|
81
|
+
export type BaseResolvedSharePayload = SharePayload & {
|
|
82
|
+
/**
|
|
83
|
+
* URI which can be used to access the shared content. When resolving contents of a URL with redirects, contains the redirect target URI.
|
|
84
|
+
* Null when resolving a [`SharePayload`](#sharepayload) with a `text` [`ShareType`](#sharetype).
|
|
85
|
+
*/
|
|
86
|
+
contentUri: string | null;
|
|
87
|
+
/**
|
|
88
|
+
* Type of the content accessible via the `contentUri`.
|
|
89
|
+
*/
|
|
90
|
+
contentType: ContentType | null;
|
|
91
|
+
/**
|
|
92
|
+
* Mime type of the content accessible via the `contentUri`.
|
|
93
|
+
*/
|
|
94
|
+
contentMimeType: string | null;
|
|
95
|
+
/**
|
|
96
|
+
* If applicable, value of the `suggestedFilename` HTTP header field, otherwise the last path component of the `contentUri` field.
|
|
97
|
+
*/
|
|
98
|
+
originalName: string | null;
|
|
99
|
+
/**
|
|
100
|
+
* Size of the content accessible via the `contentUri`.
|
|
101
|
+
*/
|
|
102
|
+
contentSize: number | null;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Represents a resolved payload, for which the data can be accessed through a URI.
|
|
106
|
+
* @platform android
|
|
107
|
+
* @platform ios
|
|
108
|
+
* @experimental
|
|
109
|
+
*/
|
|
110
|
+
export type UriBasedResolvedSharePayload = BaseResolvedSharePayload & {
|
|
111
|
+
contentType: 'audio' | 'file' | 'video' | 'image' | 'website';
|
|
112
|
+
contentUri: string;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Represents a resolved payload, where a text was shared with the app.
|
|
116
|
+
*
|
|
117
|
+
* @platform android
|
|
118
|
+
* @platform ios
|
|
119
|
+
* @experimental
|
|
120
|
+
*/
|
|
121
|
+
export type TextBasedResolvedSharePayload = BaseResolvedSharePayload & {
|
|
122
|
+
contentType?: 'text';
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Represents a payload shared with the app, with additional information about the shared contents.
|
|
126
|
+
*
|
|
127
|
+
* @platform android
|
|
128
|
+
* @platform ios
|
|
129
|
+
* @experimental
|
|
130
|
+
*/
|
|
131
|
+
export type ResolvedSharePayload = UriBasedResolvedSharePayload | TextBasedResolvedSharePayload;
|
|
132
|
+
/**
|
|
133
|
+
* Object returned by [`useIncomingShare`](#useincomingshare) hook containing information about data shared with the app.
|
|
134
|
+
*
|
|
135
|
+
* @platform android
|
|
136
|
+
* @platform ios
|
|
137
|
+
* @experimental
|
|
138
|
+
*/
|
|
139
|
+
export type UseIncomingShareResult = {
|
|
140
|
+
/**
|
|
141
|
+
* Returns unresolved payloads shared with the app. Synchronous and available immediately after creating the hook.
|
|
142
|
+
*/
|
|
143
|
+
sharedPayloads: SharePayload[];
|
|
144
|
+
/**
|
|
145
|
+
* Contains an array of resolved payloads shared with the app. Returns an empty array if the shared payloads are being resolved or if the resolving has failed.
|
|
146
|
+
*/
|
|
147
|
+
resolvedSharedPayloads: ResolvedSharePayload[];
|
|
148
|
+
/**
|
|
149
|
+
* Clears payloads shared with the app.
|
|
150
|
+
*/
|
|
151
|
+
clearSharedPayloads: () => void;
|
|
152
|
+
/**
|
|
153
|
+
* Boolean indicating whether the current shared payloads are being resolved.
|
|
154
|
+
*/
|
|
155
|
+
isResolving: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Contains an error encountered while resolving the shared payload. Null on success.
|
|
158
|
+
*/
|
|
159
|
+
error: Error | null;
|
|
160
|
+
/**
|
|
161
|
+
* Forces a refresh of the shared payloads.
|
|
162
|
+
*/
|
|
163
|
+
refreshSharePayloads: () => void;
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=Sharing.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sharing.types.d.ts","sourceRoot":"","sources":["../../src/Sharing.types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE;QACP,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAIF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpF;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG;IACpD;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG,wBAAwB,GAAG;IACpE,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IAC9D,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,GAAG;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,4BAA4B,GAAG,6BAA6B,CAAC;AAEhG;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B;;OAEG;IACH,sBAAsB,EAAE,oBAAoB,EAAE,CAAC;IAC/C;;OAEG;IACH,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB;;OAEG;IACH,oBAAoB,EAAE,MAAM,IAAI,CAAC;CAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sharing.types.js","sourceRoot":"","sources":["../../src/Sharing.types.ts"],"names":[],"mappings":"","sourcesContent":["// @needsAudit\nexport type SharingOptions = {\n /**\n * Sets `mimeType` for `Intent`.\n * @platform android\n */\n mimeType?: string;\n /**\n * [Uniform Type Identifier](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html)\n * - the type of the target file.\n * @platform ios\n */\n UTI?: string;\n /**\n * Sets share dialog title.\n * @platform android\n * @platform web\n */\n dialogTitle?: string;\n /**\n * Sets the anchor point for iPad\n * @platform ios\n */\n anchor?: {\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n };\n};\n\n// MARK: - Share into types\n\n/**\n * Determines the type of content being shared.\n * - `text`: Plain text content.\n * - `url`: A specific URL.\n * - `audio`: An audio file.\n * - `image`: An image file.\n * - `video`: A video file.\n * - `file`: A generic file.\n *\n * @platform android\n * @platform ios\n * @experimental\n */\nexport type ShareType = 'text' | 'url' | 'audio' | 'image' | 'video' | 'file';\n\n/**\n * Describes the resolved content type.\n *\n * @platform android\n * @platform ios\n * @experimental\n */\nexport type ContentType = 'text' | 'audio' | 'image' | 'video' | 'file' | 'website';\n\n/**\n * Represents raw data shared with the app.\n *\n * @platform android\n * @platform ios\n * @experimental\n */\nexport type SharePayload = {\n /**\n * The primary value of the content.\n * - For `text`, this is the message body.\n * - For `url`, this is the URL string.\n * - For `file`, `image`, `video`, or `audio`, this is typically the file URI.\n *\n * @default \"\"\n */\n value: string;\n\n /**\n * The type of the shared content.\n * @default 'text'\n */\n shareType: ShareType;\n\n /**\n * The MIME type of the contents of the`value` field.\n *\n * @default 'text/plain'\n */\n mimeType?: string;\n};\n\nexport type BaseResolvedSharePayload = SharePayload & {\n /**\n * URI which can be used to access the shared content. When resolving contents of a URL with redirects, contains the redirect target URI.\n * Null when resolving a [`SharePayload`](#sharepayload) with a `text` [`ShareType`](#sharetype).\n */\n contentUri: string | null;\n\n /**\n * Type of the content accessible via the `contentUri`.\n */\n contentType: ContentType | null;\n\n /**\n * Mime type of the content accessible via the `contentUri`.\n */\n contentMimeType: string | null;\n\n /**\n * If applicable, value of the `suggestedFilename` HTTP header field, otherwise the last path component of the `contentUri` field.\n */\n originalName: string | null;\n\n /**\n * Size of the content accessible via the `contentUri`.\n */\n contentSize: number | null;\n};\n\n/**\n * Represents a resolved payload, for which the data can be accessed through a URI.\n * @platform android\n * @platform ios\n * @experimental\n */\nexport type UriBasedResolvedSharePayload = BaseResolvedSharePayload & {\n contentType: 'audio' | 'file' | 'video' | 'image' | 'website';\n contentUri: string;\n};\n\n/**\n * Represents a resolved payload, where a text was shared with the app.\n *\n * @platform android\n * @platform ios\n * @experimental\n */\nexport type TextBasedResolvedSharePayload = BaseResolvedSharePayload & {\n contentType?: 'text';\n};\n\n/**\n * Represents a payload shared with the app, with additional information about the shared contents.\n *\n * @platform android\n * @platform ios\n * @experimental\n */\nexport type ResolvedSharePayload = UriBasedResolvedSharePayload | TextBasedResolvedSharePayload;\n\n/**\n * Object returned by [`useIncomingShare`](#useincomingshare) hook containing information about data shared with the app.\n *\n * @platform android\n * @platform ios\n * @experimental\n */\nexport type UseIncomingShareResult = {\n /**\n * Returns unresolved payloads shared with the app. Synchronous and available immediately after creating the hook.\n */\n sharedPayloads: SharePayload[];\n /**\n * Contains an array of resolved payloads shared with the app. Returns an empty array if the shared payloads are being resolved or if the resolving has failed.\n */\n resolvedSharedPayloads: ResolvedSharePayload[];\n /**\n * Clears payloads shared with the app.\n */\n clearSharedPayloads: () => void;\n /**\n * Boolean indicating whether the current shared payloads are being resolved.\n */\n isResolving: boolean;\n /**\n * Contains an error encountered while resolving the shared payload. Null on success.\n */\n error: Error | null;\n /**\n * Forces a refresh of the shared payloads.\n */\n refreshSharePayloads: () => void;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharingNativeModule.d.ts","sourceRoot":"","sources":["../../src/SharingNativeModule.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE1F,KAAK,aAAa,GAAG;IACnB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,iBAAiB,IAAI,YAAY,EAAE,CAAC;IACpC,8BAA8B,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAClE,mBAAmB,IAAI,IAAI,CAAC;IAC5B,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACtC,CAAC;;AAEF,wBAAiE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharingNativeModule.js","sourceRoot":"","sources":["../../src/SharingNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAYxD,eAAe,mBAAmB,CAAgB,aAAa,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nimport type { SharingOptions, ResolvedSharePayload, SharePayload } from './Sharing.types';\n\ntype SharingModule = {\n shareAsync(url: string, options: SharingOptions): Promise<void>;\n getSharedPayloads(): SharePayload[];\n getResolvedSharedPayloadsAsync(): Promise<ResolvedSharePayload[]>;\n clearSharedPayloads(): void;\n isAvailableAsync(): Promise<boolean>;\n};\n\nexport default requireNativeModule<SharingModule>('ExpoSharing');\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharingNativeModule.web.d.ts","sourceRoot":"","sources":["../../src/SharingNativeModule.web.ts"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;;wBAGxC,OAAO,CAAC,OAAO,CAAC;oBAOpB,MAAM,YAAW,YAAY,GAAQ,OAAO,CAAC,IAAI,CAAC;;;;;AAR1E,wBAyBE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharingNativeModule.web.js","sourceRoot":"","sources":["../../src/SharingNativeModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIxD,eAAe;IACb,KAAK,CAAC,gBAAgB;QACpB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE,CAAC;YACrC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,UAAU,CAAC,GAAW,EAAE,UAAwB,EAAE;QACtD,sDAAsD;QACtD,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;YACpB,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7C,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IACD,iBAAiB;QACf,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,KAAK,CAAC,8BAA8B;QAClC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,mBAAmB;QACjB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;CACF,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\ntype ShareOptions = { title?: string; text?: string; url?: string };\n\nexport default {\n async isAvailableAsync(): Promise<boolean> {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n return !!navigator.share;\n },\n async shareAsync(url: string, options: ShareOptions = {}): Promise<void> {\n // NOTE: `navigator.share` is only available via HTTPS\n if (navigator.share) {\n await navigator.share({ ...options, url });\n } else {\n throw new UnavailabilityError('navigator', 'share');\n }\n },\n getSharedPayloads() {\n throw new Error('Receiving share payloads is not supported on web.');\n },\n async getResolvedSharedPayloadsAsync() {\n throw new Error('Receiving share payloads is not supported on web.');\n },\n clearSharedPayloads() {\n throw new Error('Receiving share payloads is not supported on web.');\n },\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,mBAAmB,iBAAiB,CAAC;AACrC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,cAAc,WAAW,CAAC","sourcesContent":["// We usually don't export any config plugin types, but in this case it allows us to improve the readability of the docs a lot.\nexport type { ActivationRuleOptions } from '../plugin/src/sharingPlugin.types';\nexport { useIncomingShare } from './useIncomingShare';\nexport type * from './Sharing.types';\nexport * from './Sharing';\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseIncomingShareResult } from './Sharing.types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook, which returns the data shared with the application and updates the data if the shared payload has changed.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useIncomingShare(): UseIncomingShareResult;
|
|
6
|
+
//# sourceMappingURL=useIncomingShare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIncomingShare.d.ts","sourceRoot":"","sources":["../../src/useIncomingShare.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsC,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AA6B7F;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,sBAAsB,CA6DzD"}
|
|
@@ -22,10 +22,10 @@ function sharePayloadsAreEqual(a, b) {
|
|
|
22
22
|
return true;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Hook, which returns the data shared with the application and updates the data if the shared payload has changed.
|
|
26
26
|
*/
|
|
27
27
|
export function useIncomingShare() {
|
|
28
|
-
const [sharedPayloads, setSharedPayloads] = useState(
|
|
28
|
+
const [sharedPayloads, setSharedPayloads] = useState(getSharedPayloads());
|
|
29
29
|
const [resolvedSharedPayloads, setResolvedSharedPayloads] = useState([]);
|
|
30
30
|
const [isResolving, setIsResolving] = useState(false);
|
|
31
31
|
const [error, setError] = useState(null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIncomingShare.js","sourceRoot":"","sources":["../../src/useIncomingShare.ts"],"names":[],"mappings":"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","sourcesContent":["import { useEffect, useState, useCallback, useRef } from 'react';\nimport { AppState, AppStateStatus } from 'react-native';\n\nimport { clearSharedPayloads, getResolvedSharedPayloadsAsync, getSharedPayloads } from './Sharing';\nimport { ResolvedSharePayload, SharePayload, UseIncomingShareResult } from './Sharing.types';\n\nfunction sharePayloadsAreEqual(a: SharePayload[], b: SharePayload[]): boolean {\n if (a.length !== b.length) {\n return false;\n }\n\n const counts = new Map<string, number>();\n const getKey = (item: SharePayload) => `${item.value}|${item.mimeType}|${item.shareType}`;\n\n for (const item of a) {\n const key = getKey(item);\n counts.set(key, (counts.get(key) || 0) + 1);\n }\n\n for (const item of b) {\n const key = getKey(item);\n const count = counts.get(key);\n\n if (!count) {\n return false;\n }\n\n counts.set(key, count - 1);\n }\n\n return true;\n}\n\n/**\n * Hook, which returns the data shared with the application and updates the data if the shared payload has changed.\n */\nexport function useIncomingShare(): UseIncomingShareResult {\n const [sharedPayloads, setSharedPayloads] = useState<SharePayload[]>(getSharedPayloads());\n const [resolvedSharedPayloads, setResolvedSharedPayloads] = useState<ResolvedSharePayload[]>([]);\n const [isResolving, setIsResolving] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const currentSharedDataRef = useRef<SharePayload[]>([]);\n\n const refreshSharePayloads = useCallback(async () => {\n try {\n const newSharedData: SharePayload[] = getSharedPayloads();\n\n // Do not run `getResolvedSharedDataAsync` if the data hasn't changed to reduce network usage\n if (sharePayloadsAreEqual(newSharedData, currentSharedDataRef.current)) {\n return;\n }\n\n currentSharedDataRef.current = newSharedData;\n setSharedPayloads(newSharedData);\n setResolvedSharedPayloads([]);\n setError(null);\n\n if (newSharedData.length > 0) {\n setIsResolving(true);\n try {\n const resolved = await getResolvedSharedPayloadsAsync();\n setResolvedSharedPayloads(resolved);\n } catch (e) {\n setError(\n e instanceof Error ? e : new Error('Unknown error during shared payload resolution')\n );\n } finally {\n setIsResolving(false);\n }\n }\n } catch (e) {\n setError(e instanceof Error ? e : new Error('Failed to resolve data'));\n }\n }, []);\n\n useEffect(() => {\n refreshSharePayloads();\n\n const subscription = AppState.addEventListener('change', (nextAppState: AppStateStatus) => {\n if (nextAppState === 'active') {\n refreshSharePayloads();\n }\n });\n\n return () => {\n subscription.remove();\n };\n }, [refreshSharePayloads]);\n\n return {\n sharedPayloads,\n resolvedSharedPayloads,\n clearSharedPayloads,\n isResolving,\n error,\n refreshSharePayloads,\n };\n}\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.sharing",
|
|
6
|
-
"version": "55.0.
|
|
6
|
+
"version": "55.0.4",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.sharing-55.0.
|
|
28
|
-
"url": "expo.modules.sharing-55.0.
|
|
27
|
+
"name": "expo.modules.sharing-55.0.4.aar",
|
|
28
|
+
"url": "expo.modules.sharing-55.0.4.aar",
|
|
29
29
|
"size": 51161,
|
|
30
30
|
"sha512": "d27826a7cd3f840764e8b3a4357d92162c74f356986608361ca0dc510efec34ce37cb92f3ebe37d845ad765ecb467172bae75aee4e62f1f064aaec60a37befd5",
|
|
31
31
|
"sha256": "8221fe23694bf5c57e7a5dabfa4a7a994330ca9f9256ba7a63c93ac8f1ba6c59",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
],
|
|
58
58
|
"files": [
|
|
59
59
|
{
|
|
60
|
-
"name": "expo.modules.sharing-55.0.
|
|
61
|
-
"url": "expo.modules.sharing-55.0.
|
|
60
|
+
"name": "expo.modules.sharing-55.0.4.aar",
|
|
61
|
+
"url": "expo.modules.sharing-55.0.4.aar",
|
|
62
62
|
"size": 51161,
|
|
63
63
|
"sha512": "d27826a7cd3f840764e8b3a4357d92162c74f356986608361ca0dc510efec34ce37cb92f3ebe37d845ad765ecb467172bae75aee4e62f1f064aaec60a37befd5",
|
|
64
64
|
"sha256": "8221fe23694bf5c57e7a5dabfa4a7a994330ca9f9256ba7a63c93ac8f1ba6c59",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
},
|
|
78
78
|
"files": [
|
|
79
79
|
{
|
|
80
|
-
"name": "expo.modules.sharing-55.0.
|
|
81
|
-
"url": "expo.modules.sharing-55.0.
|
|
80
|
+
"name": "expo.modules.sharing-55.0.4-sources.jar",
|
|
81
|
+
"url": "expo.modules.sharing-55.0.4-sources.jar",
|
|
82
82
|
"size": 9631,
|
|
83
83
|
"sha512": "3d2b08feb71a60728c0329313947a379ad90bd2af4085b213f1163decf66cfbf607bdc893ef9155ac2f1b9c8371fa200910c5e08a9520be43a073db6133f0755",
|
|
84
84
|
"sha256": "b0d94febab7341670784b8d15f4668d02085cba33a4bf026919c00445c677273",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
39f241545ddcdc8cda15debb4b3e2eac
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dd8e4fd093dff0c7f94b1545fb2cfb35cf45b511
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ddbd446210bf5fee38d69543b3fa2e2d5dd896c9d1741c9229c45a4b81a424da
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9f099e4fc658074dc60f8372129c52c55f6de577c0363f87bcc496a3dc6c6754d6af29ea049f7a11ef2d175f908a9e5188adec98b314891ecf5960e033bfb8be
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.sharing</artifactId>
|
|
12
|
-
<version>55.0.
|
|
12
|
+
<version>55.0.4</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.sharing</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8df259998356b34bc00f89abb73109d2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1b05be131dc32777ed81483924473062a69f5e24
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c41523ec4092a122967ec734194488f265aca005341b7e0799385e3fd4736094
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2a8cda7bc45974a4c5989c5b7791d0d6d2c7549b0a60bab8f656d3de4b9f161b01d0c822b156782d85af903a844a363ce31b9a0b4e25bd1df997dcebe227e557
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.sharing</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>55.0.
|
|
7
|
-
<release>55.0.
|
|
6
|
+
<latest>55.0.4</latest>
|
|
7
|
+
<release>55.0.4</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>55.0.
|
|
9
|
+
<version>55.0.4</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260127201426</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1a2c6dd8986671a8256e54bb5e6af416
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
77c1d30485022e2b43549a9d2a2bfa726bbdc4d4
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a37d47c4e56237ae90bc67d9bf31a86408e81c02219cc0156dc419def38aadc6
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f64eb9ffc3c549e5098ad4648f2ba61f5634d1da027b53a383a99be8de0dc79ac4af99935fe44630b20e23130a46890b59fe968ce6eefa1ff7fbde953e4d5e64
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-sharing",
|
|
3
|
-
"version": "55.0.
|
|
3
|
+
"version": "55.0.4",
|
|
4
4
|
"description": "Provides a way to share files directly with other compatible applications.",
|
|
5
|
-
"main": "build/index.js",
|
|
6
|
-
"types": "build/index.d.ts",
|
|
5
|
+
"main": "build/src/index.js",
|
|
6
|
+
"types": "build/src/index.d.ts",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "expo-module build",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"react": "*",
|
|
48
48
|
"react-native": "*"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "220594d473a3100248087151004ae4acb7282d5f"
|
|
51
51
|
}
|