expo-sharing 10.2.0 → 10.3.0
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 +6 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/sharing/SharingModule.kt +1 -2
- package/build/Sharing.d.ts +1 -1
- package/build/Sharing.d.ts.map +1 -1
- package/build/Sharing.js.map +1 -1
- package/ios/EXSharing/EXSharingModule.m +1 -1
- package/package.json +2 -2
- package/src/Sharing.ts +1 -1
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 10.3.0 — 2022-07-07
|
|
14
|
+
|
|
15
|
+
### 🛠 Breaking changes
|
|
16
|
+
|
|
17
|
+
- Changed the return type of the `shareAsync` function. The promise now resolves to `void` instead of an empty object. ([#18019](https://github.com/expo/expo/pull/18019) by [@barthap](https://github.com/barthap))
|
|
18
|
+
|
|
13
19
|
## 10.2.0 — 2022-04-18
|
|
14
20
|
|
|
15
21
|
### ⚠️ Notices
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '10.
|
|
6
|
+
version = '10.3.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -74,7 +74,7 @@ android {
|
|
|
74
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
75
75
|
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
76
76
|
versionCode 16
|
|
77
|
-
versionName '10.
|
|
77
|
+
versionName '10.3.0'
|
|
78
78
|
}
|
|
79
79
|
lintOptions {
|
|
80
80
|
abortOnError false
|
|
@@ -5,7 +5,6 @@ import android.content.Context
|
|
|
5
5
|
import android.content.Intent
|
|
6
6
|
import android.content.pm.PackageManager
|
|
7
7
|
import android.net.Uri
|
|
8
|
-
import android.os.Bundle
|
|
9
8
|
import androidx.core.content.FileProvider
|
|
10
9
|
import expo.modules.core.ExportedModule
|
|
11
10
|
import expo.modules.core.ModuleRegistry
|
|
@@ -111,7 +110,7 @@ class SharingModule(
|
|
|
111
110
|
|
|
112
111
|
override fun onActivityResult(activity: Activity, requestCode: Int, resultCode: Int, data: Intent?) {
|
|
113
112
|
if (requestCode == REQUEST_CODE && pendingPromise != null) {
|
|
114
|
-
pendingPromise?.resolve(
|
|
113
|
+
pendingPromise?.resolve(null)
|
|
115
114
|
pendingPromise = null
|
|
116
115
|
}
|
|
117
116
|
}
|
package/build/Sharing.d.ts
CHANGED
|
@@ -27,5 +27,5 @@ export declare function isAvailableAsync(): Promise<boolean>;
|
|
|
27
27
|
* @param url Local file URL to share.
|
|
28
28
|
* @param options A map of share options.
|
|
29
29
|
*/
|
|
30
|
-
export declare function shareAsync(url: string, options?: SharingOptions): Promise<
|
|
30
|
+
export declare function shareAsync(url: string, options?: SharingOptions): Promise<void>;
|
|
31
31
|
//# sourceMappingURL=Sharing.d.ts.map
|
package/build/Sharing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sharing.d.ts","sourceRoot":"","sources":["../src/Sharing.ts"],"names":[],"mappings":"AAKA,oBAAY,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;CACtB,CAAC;AAGF;;;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,
|
|
1
|
+
{"version":3,"file":"Sharing.d.ts","sourceRoot":"","sources":["../src/Sharing.ts"],"names":[],"mappings":"AAKA,oBAAY,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;CACtB,CAAC;AAGF;;;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"}
|
package/build/Sharing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sharing.js","sourceRoot":"","sources":["../src/Sharing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,OAAO,MAAM,eAAe,CAAC;AAuBpC,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,OAAO,EAAE;QACX,IAAI,OAAO,CAAC,gBAAgB,EAAE;YAC5B,OAAO,MAAM,OAAO,CAAC,gBAAgB,EAAE,CAAC;SACzC;QACD,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,UAA0B,EAAE;IACxE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;QACnC,MAAM,IAAI,mBAAmB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;KACxD;IACD,OAAO,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport Sharing from './ExpoSharing';\n\n// @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\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 (Sharing) {\n if (Sharing.isAvailableAsync) {\n return await Sharing.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<
|
|
1
|
+
{"version":3,"file":"Sharing.js","sourceRoot":"","sources":["../src/Sharing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,OAAO,MAAM,eAAe,CAAC;AAuBpC,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,OAAO,EAAE;QACX,IAAI,OAAO,CAAC,gBAAgB,EAAE;YAC5B,OAAO,MAAM,OAAO,CAAC,gBAAgB,EAAE,CAAC;SACzC;QACD,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,UAA0B,EAAE;IACxE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;QACnC,MAAM,IAAI,mBAAmB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;KACxD;IACD,OAAO,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport Sharing from './ExpoSharing';\n\n// @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\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 (Sharing) {\n if (Sharing.isAvailableAsync) {\n return await Sharing.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 (!Sharing || !Sharing.shareAsync) {\n throw new UnavailabilityError('Sharing', 'shareAsync');\n }\n return await Sharing.shareAsync(url, options);\n}\n"]}
|
|
@@ -65,7 +65,7 @@ EX_EXPORT_METHOD_AS(shareAsync,
|
|
|
65
65
|
|
|
66
66
|
- (void)documentInteractionControllerDidDismissOpenInMenu:(UIDocumentInteractionController *)controller
|
|
67
67
|
{
|
|
68
|
-
_pendingResolver(
|
|
68
|
+
_pendingResolver(nil);
|
|
69
69
|
_pendingResolver = nil;
|
|
70
70
|
|
|
71
71
|
_documentInteractionController = nil;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-sharing",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.0",
|
|
4
4
|
"description": "ExpoSharing standalone module",
|
|
5
5
|
"main": "build/Sharing.js",
|
|
6
6
|
"types": "build/Sharing.d.ts",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"expo": "*"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "6e131f2da851a47c3a24eb3d6fc971a1a7822086"
|
|
41
41
|
}
|
package/src/Sharing.ts
CHANGED
|
@@ -45,7 +45,7 @@ export async function isAvailableAsync(): Promise<boolean> {
|
|
|
45
45
|
* @param url Local file URL to share.
|
|
46
46
|
* @param options A map of share options.
|
|
47
47
|
*/
|
|
48
|
-
export async function shareAsync(url: string, options: SharingOptions = {}): Promise<
|
|
48
|
+
export async function shareAsync(url: string, options: SharingOptions = {}): Promise<void> {
|
|
49
49
|
if (!Sharing || !Sharing.shareAsync) {
|
|
50
50
|
throw new UnavailabilityError('Sharing', 'shareAsync');
|
|
51
51
|
}
|
package/tsconfig.json
CHANGED