expo-sms 11.7.0 → 12.0.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 +15 -0
- package/android/build.gradle +7 -93
- package/android/src/main/java/expo/modules/sms/SMSModule.kt +1 -1
- package/android/src/main/java/expo/modules/sms/SMSOptions.kt +1 -1
- package/build/ExpoSMS.d.ts.map +1 -1
- package/build/ExpoSMS.js +1 -2
- package/build/ExpoSMS.js.map +1 -1
- package/build/ExpoSMS.native.d.ts +3 -0
- package/build/ExpoSMS.native.d.ts.map +1 -0
- package/build/ExpoSMS.native.js +3 -0
- package/build/ExpoSMS.native.js.map +1 -0
- package/build/SMS.js +1 -1
- package/build/SMS.js.map +1 -1
- package/package.json +2 -2
- package/src/ExpoSMS.native.ts +2 -0
- package/src/ExpoSMS.ts +1 -2
- package/src/SMS.ts +1 -1
- package/build/ExpoSMS.web.d.ts +0 -8
- package/build/ExpoSMS.web.d.ts.map +0 -1
- package/build/ExpoSMS.web.js +0 -13
- package/build/ExpoSMS.web.js.map +0 -1
- package/src/ExpoSMS.web.ts +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,21 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 12.0.0 — 2024-04-18
|
|
14
|
+
|
|
15
|
+
### 🛠 Breaking changes
|
|
16
|
+
|
|
17
|
+
- [web] `sendSMSAsync` now throws error code `ERR_UNAVAILABLE` instead of `E_SMS_UNAVAILABLE`. ([#27437](https://github.com/expo/expo/pull/27437) by [@EvanBacon](https://github.com/EvanBacon))
|
|
18
|
+
|
|
19
|
+
### 💡 Others
|
|
20
|
+
|
|
21
|
+
- drop unused web `name` property. ([#27437](https://github.com/expo/expo/pull/27437) by [@EvanBacon](https://github.com/EvanBacon))
|
|
22
|
+
- Removed deprecated backward compatible Gradle settings. ([#28083](https://github.com/expo/expo/pull/28083) by [@kudo](https://github.com/kudo))
|
|
23
|
+
|
|
24
|
+
## 11.7.1 - 2023-12-19
|
|
25
|
+
|
|
26
|
+
_This version does not introduce any user-facing changes._
|
|
27
|
+
|
|
13
28
|
## 11.7.0 — 2023-11-14
|
|
14
29
|
|
|
15
30
|
### 🛠 Breaking changes
|
package/android/build.gradle
CHANGED
|
@@ -1,110 +1,24 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
|
-
apply plugin: 'kotlin-android'
|
|
3
|
-
apply plugin: 'maven-publish'
|
|
4
2
|
|
|
5
3
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '
|
|
4
|
+
version = '12.0.0'
|
|
7
5
|
|
|
8
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
useExpoPublishing()
|
|
15
|
-
useCoreDependencies()
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
buildscript {
|
|
20
|
-
// Simple helper that allows the root project to override versions declared by this library.
|
|
21
|
-
ext.safeExtGet = { prop, fallback ->
|
|
22
|
-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Ensures backward compatibility
|
|
26
|
-
ext.getKotlinVersion = {
|
|
27
|
-
if (ext.has("kotlinVersion")) {
|
|
28
|
-
ext.kotlinVersion()
|
|
29
|
-
} else {
|
|
30
|
-
ext.safeExtGet("kotlinVersion", "1.8.10")
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
repositories {
|
|
35
|
-
mavenCentral()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
dependencies {
|
|
39
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
44
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
45
|
-
afterEvaluate {
|
|
46
|
-
publishing {
|
|
47
|
-
publications {
|
|
48
|
-
release(MavenPublication) {
|
|
49
|
-
from components.release
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
repositories {
|
|
53
|
-
maven {
|
|
54
|
-
url = mavenLocal().url
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
7
|
+
apply from: expoModulesCorePlugin
|
|
8
|
+
applyKotlinExpoModulesCorePlugin()
|
|
9
|
+
useCoreDependencies()
|
|
10
|
+
useDefaultAndroidSdkVersions()
|
|
11
|
+
useExpoPublishing()
|
|
60
12
|
|
|
61
13
|
android {
|
|
62
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
63
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
64
|
-
compileSdkVersion safeExtGet("compileSdkVersion", 34)
|
|
65
|
-
|
|
66
|
-
defaultConfig {
|
|
67
|
-
minSdkVersion safeExtGet("minSdkVersion", 23)
|
|
68
|
-
targetSdkVersion safeExtGet("targetSdkVersion", 34)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
publishing {
|
|
72
|
-
singleVariant("release") {
|
|
73
|
-
withSourcesJar()
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
lintOptions {
|
|
78
|
-
abortOnError false
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
|
|
83
|
-
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
|
|
84
|
-
compileOptions {
|
|
85
|
-
sourceCompatibility JavaVersion.VERSION_11
|
|
86
|
-
targetCompatibility JavaVersion.VERSION_11
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
kotlinOptions {
|
|
90
|
-
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
14
|
namespace "expo.modules.sms"
|
|
95
15
|
defaultConfig {
|
|
96
16
|
versionCode 28
|
|
97
|
-
versionName "
|
|
17
|
+
versionName "12.0.0"
|
|
98
18
|
}
|
|
99
19
|
}
|
|
100
20
|
|
|
101
21
|
dependencies {
|
|
102
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
103
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
104
|
-
implementation project(':expo-modules-core')
|
|
105
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
106
|
-
}
|
|
107
|
-
|
|
108
22
|
implementation 'androidx.annotation:annotation:1.1.0'
|
|
109
23
|
|
|
110
24
|
if (project.findProject(':expo-modules-test-core')) {
|
|
@@ -35,7 +35,7 @@ class SMSModule : Module(), LifecycleEventListener {
|
|
|
35
35
|
sendSMSAsync(addresses, message, options, promise)
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
AsyncFunction("isAvailableAsync") {
|
|
38
|
+
AsyncFunction<Boolean>("isAvailableAsync") {
|
|
39
39
|
return@AsyncFunction context.packageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)
|
|
40
40
|
}
|
|
41
41
|
|
package/build/ExpoSMS.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSMS.d.ts","sourceRoot":"","sources":["../src/ExpoSMS.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ExpoSMS.d.ts","sourceRoot":"","sources":["../src/ExpoSMS.ts"],"names":[],"mappings":"wBAAqB,GAAG;AAAxB,wBAAyB"}
|
package/build/ExpoSMS.js
CHANGED
package/build/ExpoSMS.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSMS.js","sourceRoot":"","sources":["../src/ExpoSMS.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ExpoSMS.js","sourceRoot":"","sources":["../src/ExpoSMS.ts"],"names":[],"mappings":"AAAA,eAAe,EAAS,CAAC","sourcesContent":["export default {} as any;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoSMS.native.d.ts","sourceRoot":"","sources":["../src/ExpoSMS.native.ts"],"names":[],"mappings":";AACA,wBAA8C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoSMS.native.js","sourceRoot":"","sources":["../src/ExpoSMS.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,eAAe,mBAAmB,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\nexport default requireNativeModule('ExpoSMS');\n"]}
|
package/build/SMS.js
CHANGED
package/build/SMS.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SMS.js","sourceRoot":"","sources":["../src/SMS.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,OAAO,MAAM,WAAW,CAAC;AAKhC,SAAS,kBAAkB,CACzB,WAAwD;IAExD,IAAI,CAAC,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"SMS.js","sourceRoot":"","sources":["../src/SMS.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,OAAO,MAAM,WAAW,CAAC;AAKhC,SAAS,kBAAkB,CACzB,WAAwD;IAExD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,WAAW,GAAG,KAAK,CAAC,OAAO,C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YAAY,CAAC,CAAC;AACrE,CAAC;AAED,cAAc;AACd;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,OAAO,OAAO,CAAC,gBAAgB,EAAE,EAAE,IAAI,KAAK,CAAC;AAC/C,CAAC","sourcesContent":["/* eslint-disable no-unused-expressions */\nimport { UnavailabilityError, Platform } from 'expo-modules-core';\n\nimport ExpoSMS from './ExpoSMS';\nimport { SMSAttachment, SMSResponse, SMSOptions } from './SMS.types';\n\nexport { SMSAttachment, SMSResponse, SMSOptions };\n\nfunction processAttachments(\n attachments: SMSAttachment | SMSAttachment[] | undefined\n): SMSAttachment[] | null {\n if (!attachments) {\n return null;\n }\n attachments = Array.isArray(attachments) ? attachments : [attachments];\n if (Platform.OS === 'android' && attachments.length > 1) {\n if (__DEV__) {\n console.warn('Android only supports a single attachment. The first array item is used.');\n }\n attachments = attachments.slice(0, 1);\n }\n return attachments;\n}\n\n// @needsAudit\n/**\n * Opens the default UI/app for sending SMS messages with prefilled addresses and message.\n *\n * @param addresses An array of addresses (phone numbers) or single address passed as strings. Those\n * would appear as recipients of the prepared message.\n * @param message Message to be sent.\n * @param options A `SMSOptions` object defining additional SMS configuration options.\n *\n * @return Returns a Promise that fulfils with the SMS action is invoked by the user, with corresponding result:\n * - If the user cancelled the SMS sending process: `{ result: 'cancelled' }`.\n * - If the user has sent/scheduled message for sending: `{ result: 'sent' }`.\n * - If the status of the SMS message cannot be determined: `{ result: 'unknown' }`.\n *\n * Android does not provide information about the status of the SMS message, so on Android devices\n * the Promise will always resolve with `{ result: 'unknown' }`.\n *\n * > Note: The only feedback collected by this module is whether any message has been sent. That\n * means we do not check actual content of message nor recipients list.\n *\n * @example\n * ```ts\n * const { result } = await SMS.sendSMSAsync(\n * ['0123456789', '9876543210'],\n * 'My sample HelloWorld message',\n * {\n * attachments: {\n * uri: 'path/myfile.png',\n * mimeType: 'image/png',\n * filename: 'myfile.png',\n * },\n * }\n * );\n * ```\n */\nexport async function sendSMSAsync(\n addresses: string | string[],\n message: string,\n options?: SMSOptions\n): Promise<SMSResponse> {\n if (!ExpoSMS.sendSMSAsync) {\n throw new UnavailabilityError('expo-sms', 'sendSMSAsync');\n }\n const finalAddresses = Array.isArray(addresses) ? addresses : [addresses];\n finalAddresses.forEach((address) => {\n if (address === null || address === undefined) {\n throw new TypeError('undefined or null address');\n }\n });\n const finalOptions = {\n ...options,\n } as SMSOptions;\n if (options?.attachments) {\n finalOptions.attachments = processAttachments(options?.attachments) || undefined;\n }\n return ExpoSMS.sendSMSAsync(finalAddresses, message, finalOptions);\n}\n\n// @needsAudit\n/**\n * Determines whether SMS is available. Always returns `false` in the iOS simulator, and in browser.\n *\n * @return Returns a promise that fulfils with a `boolean`, indicating whether SMS is available on this device.\n *\n * @example\n * ```ts\n * const isAvailable = await SMS.isAvailableAsync();\n * if (isAvailable) {\n * // do your SMS stuff here\n * } else {\n * // misfortune... there's no SMS available on this device\n * }\n * ```\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n return ExpoSMS.isAvailableAsync?.() ?? false;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-sms",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Provides access to the system's UI/app for sending SMS messages.",
|
|
5
5
|
"main": "build/SMS.js",
|
|
6
6
|
"types": "build/SMS.d.ts",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"expo": "*"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "4165b8d72e1b9a1889c2767534cc619e21468110"
|
|
44
44
|
}
|
package/src/ExpoSMS.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default requireNativeModule('ExpoSMS');
|
|
1
|
+
export default {} as any;
|
package/src/SMS.ts
CHANGED
package/build/ExpoSMS.web.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SMSResponse } from './SMS.types';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
readonly name: string;
|
|
4
|
-
isAvailableAsync(): Promise<boolean>;
|
|
5
|
-
sendSMSAsync(addresses: string[], message: string): Promise<SMSResponse>;
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
8
|
-
//# sourceMappingURL=ExpoSMS.web.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSMS.web.d.ts","sourceRoot":"","sources":["../src/ExpoSMS.web.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;;;wBAMd,QAAQ,OAAO,CAAC;4BAGZ,MAAM,EAAE,WAAW,MAAM,GAAG,QAAQ,WAAW,CAAC;;AAPhF,wBAUE"}
|
package/build/ExpoSMS.web.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CodedError } from 'expo-modules-core';
|
|
2
|
-
export default {
|
|
3
|
-
get name() {
|
|
4
|
-
return 'ExpoSMS';
|
|
5
|
-
},
|
|
6
|
-
async isAvailableAsync() {
|
|
7
|
-
return false;
|
|
8
|
-
},
|
|
9
|
-
async sendSMSAsync(addresses, message) {
|
|
10
|
-
throw new CodedError('E_SMS_UNAVAILABLE', 'SMS not available');
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=ExpoSMS.web.js.map
|
package/build/ExpoSMS.web.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSMS.web.js","sourceRoot":"","sources":["../src/ExpoSMS.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,eAAe;IACb,IAAI,IAAI;QACN,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,KAAK,CAAC,gBAAgB;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,KAAK,CAAC,YAAY,CAAC,SAAmB,EAAE,OAAe;QACrD,MAAM,IAAI,UAAU,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;IACjE,CAAC;CACF,CAAC","sourcesContent":["import { CodedError } from 'expo-modules-core';\n\nimport { SMSResponse } from './SMS.types';\n\nexport default {\n get name(): string {\n return 'ExpoSMS';\n },\n async isAvailableAsync(): Promise<boolean> {\n return false;\n },\n async sendSMSAsync(addresses: string[], message: string): Promise<SMSResponse> {\n throw new CodedError('E_SMS_UNAVAILABLE', 'SMS not available');\n },\n};\n"]}
|
package/src/ExpoSMS.web.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CodedError } from 'expo-modules-core';
|
|
2
|
-
|
|
3
|
-
import { SMSResponse } from './SMS.types';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
get name(): string {
|
|
7
|
-
return 'ExpoSMS';
|
|
8
|
-
},
|
|
9
|
-
async isAvailableAsync(): Promise<boolean> {
|
|
10
|
-
return false;
|
|
11
|
-
},
|
|
12
|
-
async sendSMSAsync(addresses: string[], message: string): Promise<SMSResponse> {
|
|
13
|
-
throw new CodedError('E_SMS_UNAVAILABLE', 'SMS not available');
|
|
14
|
-
},
|
|
15
|
-
};
|