@symbiote-native/sms 0.1.0 → 0.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/README.md +23 -20
- package/build/core/index.d.ts +1 -1
- package/build/core/sms.js +3 -1
- package/build-ngc/core/index.d.ts +1 -1
- package/build-ngc/core/native-module.js.map +1 -1
- package/build-ngc/core/sms.js +3 -1
- package/build-ngc/core/sms.js.map +1 -1
- package/package.json +46 -18
- package/src/core/index.ts +6 -1
- package/src/core/native-module.ts +2 -1
- package/src/core/sms.ts +6 -2
- package/build/react/index.d.ts +0 -1
- package/build/react/index.js +0 -6
- package/build/vue/index.d.ts +0 -1
- package/build/vue/index.js +0 -4
- package/src/react/index.ts +0 -6
- package/src/vue/index.ts +0 -4
package/README.md
CHANGED
|
@@ -28,12 +28,12 @@ Unlike a plain RN native module, `expo-sms`'s native code is discovered by
|
|
|
28
28
|
`expo-modules-autolinking` — this needs wiring into the native host app **once**, covering this
|
|
29
29
|
package and every other `expo-modules-core` package with zero further changes:
|
|
30
30
|
|
|
31
|
-
| Platform | Touches
|
|
32
|
-
|
|
33
|
-
| iOS
|
|
34
|
-
| iOS
|
|
35
|
-
| Android
|
|
36
|
-
| Android
|
|
31
|
+
| Platform | Touches |
|
|
32
|
+
| -------- | ------------------------------------------------------------------------------------- |
|
|
33
|
+
| iOS | `ios/Podfile` — add `use_expo_modules!` |
|
|
34
|
+
| iOS | `AppDelegate.swift` — Expo's runtime-bootstrap hook |
|
|
35
|
+
| Android | `settings.gradle` / `app/build.gradle` — resolve and include the Expo Gradle projects |
|
|
36
|
+
| Android | `MainApplication.kt` — Expo's bootstrap hook, plus a native-module name map |
|
|
37
37
|
|
|
38
38
|
Full mechanics live in the `symbiote-expo-native-module` skill. The per-package half of that
|
|
39
39
|
table — the Gradle dependency and the module map entry — is generated by
|
|
@@ -47,7 +47,7 @@ This is the least invasive of the Expo wrappers here:
|
|
|
47
47
|
- **No runtime permission on either platform.** Opening the composer is an intent
|
|
48
48
|
(`ACTION_SENDTO`/`ACTION_SEND`) on Android and an `MFMessageComposeViewController` on iOS —
|
|
49
49
|
the user's own app does the sending, so neither platform asks for one. `expo-sms` requests no
|
|
50
|
-
permission anywhere in its native code, and reading the
|
|
50
|
+
permission anywhere in its native code, and reading the _outcome_ of a sent message on Android
|
|
51
51
|
would need `READ_SMS`, which is exactly why it doesn't try (see the `unknown` result below).
|
|
52
52
|
- **No `Info.plist` usage-description key.**
|
|
53
53
|
- **No manifest edit.** `expo-sms` ships its own `<queries>` block declaring the `SEND`/`SENDTO`
|
|
@@ -60,17 +60,17 @@ This is the least invasive of the Expo wrappers here:
|
|
|
60
60
|
```
|
|
61
61
|
src/core/ the whole API: sendSMSAsync + isAvailableAsync. native-module.ts
|
|
62
62
|
resolves ExpoSMS through expo-modules-core's requireNativeModule.
|
|
63
|
-
src/react/ @symbiote-native/sms/react
|
|
64
|
-
src/vue/ @symbiote-native/sms/vue
|
|
65
63
|
src/angular/ @symbiote-native/sms/angular
|
|
66
64
|
```
|
|
67
65
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
there is no event stream — so there is
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
`./react`, `./vue`, and `./svelte` are `exports`-map aliases straight onto `src/core/` — no
|
|
67
|
+
physical per-framework file. Both exports are stateless free functions — `sendSMSAsync` resolves
|
|
68
|
+
once the composer closes and holds nothing afterwards, and there is no event stream — so there is
|
|
69
|
+
nothing for a hook, composable, or service to wrap, the same reason
|
|
70
|
+
[`@symbiote-native/secure-store`](../secure-store) does the same. `./angular` stays a physical
|
|
71
|
+
file/subpath since Angular ships through a separate `ngc`/AOT build (`build-ngc/`). Import from
|
|
72
|
+
`@symbiote-native/sms` directly if you don't care which adapter you're on; the per-adapter
|
|
73
|
+
subpaths exist so every wrapper package has the same import surface.
|
|
74
74
|
|
|
75
75
|
## Use it
|
|
76
76
|
|
|
@@ -78,7 +78,10 @@ per-adapter subpaths exist so every wrapper package has the same import surface.
|
|
|
78
78
|
import { isAvailableAsync, sendSMSAsync } from '@symbiote-native/sms';
|
|
79
79
|
|
|
80
80
|
if (await isAvailableAsync()) {
|
|
81
|
-
const { result } = await sendSMSAsync(
|
|
81
|
+
const { result } = await sendSMSAsync(
|
|
82
|
+
['0123456789', '9876543210'],
|
|
83
|
+
'Running late, sorry!',
|
|
84
|
+
);
|
|
82
85
|
// 'sent' | 'cancelled' on iOS; always 'unknown' on Android
|
|
83
86
|
}
|
|
84
87
|
```
|
|
@@ -107,10 +110,10 @@ file path is not readable from there.
|
|
|
107
110
|
|
|
108
111
|
## API
|
|
109
112
|
|
|
110
|
-
| Export
|
|
111
|
-
|
|
112
|
-
| `isAvailableAsync` | `() => Promise<boolean>`
|
|
113
|
-
| `sendSMSAsync`
|
|
113
|
+
| Export | Signature | Notes |
|
|
114
|
+
| ------------------ | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
115
|
+
| `isAvailableAsync` | `() => Promise<boolean>` | `false` on the iOS simulator, which has no Messages app, and on Android devices without telephony hardware. |
|
|
116
|
+
| `sendSMSAsync` | `(addresses, message, options?) => Promise<ISmsResponse>` | Opens the composer. Resolves when it closes. Throws if the device has no messaging app. |
|
|
114
117
|
|
|
115
118
|
`ISmsOptions`: `attachments` — one `ISmsAttachment` or a list of them.
|
|
116
119
|
`ISmsAttachment`: `uri` (content URI), `mimeType`, `filename`.
|
package/build/core/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { isAvailableAsync, sendSMSAsync } from './sms';
|
|
2
|
-
export type { ISmsAttachment, ISmsOptions, ISmsResponse, ISmsResultStatus } from './types';
|
|
2
|
+
export type { ISmsAttachment, ISmsOptions, ISmsResponse, ISmsResultStatus, } from './types';
|
package/build/core/sms.js
CHANGED
|
@@ -43,5 +43,7 @@ export async function sendSMSAsync(addresses, message, options) {
|
|
|
43
43
|
}
|
|
44
44
|
function normalizeAttachments(attachments) {
|
|
45
45
|
const list = Array.isArray(attachments) ? attachments : [attachments];
|
|
46
|
-
return Platform.OS === 'android'
|
|
46
|
+
return Platform.OS === 'android'
|
|
47
|
+
? list.slice(0, ANDROID_ATTACHMENT_LIMIT)
|
|
48
|
+
: list;
|
|
47
49
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { isAvailableAsync, sendSMSAsync } from './sms';
|
|
2
|
-
export type { ISmsAttachment, ISmsOptions, ISmsResponse, ISmsResultStatus } from './types';
|
|
2
|
+
export type { ISmsAttachment, ISmsOptions, ISmsResponse, ISmsResultStatus, } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAuBvC,MAAM,CAAC,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAuBvC,MAAM,CAAC,MAAM,OAAO,GAClB,mBAAmB,CAAmB,oBAAoB,CAAC,CAAC"}
|
package/build-ngc/core/sms.js
CHANGED
|
@@ -43,6 +43,8 @@ export async function sendSMSAsync(addresses, message, options) {
|
|
|
43
43
|
}
|
|
44
44
|
function normalizeAttachments(attachments) {
|
|
45
45
|
const list = Array.isArray(attachments) ? attachments : [attachments];
|
|
46
|
-
return Platform.OS === 'android'
|
|
46
|
+
return Platform.OS === 'android'
|
|
47
|
+
? list.slice(0, ANDROID_ATTACHMENT_LIMIT)
|
|
48
|
+
: list;
|
|
47
49
|
}
|
|
48
50
|
//# sourceMappingURL=sms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sms.js","source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AAS,oBAAoB,CAC3B,WAA8C;IAE9C,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACtE,OAAO,QAAQ,CAAC,EAAE,KAAK,SAAS;QAC9B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,wBAAwB,CAAC;QACzC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/sms",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "expo-sms wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, and Angular adapters. Opens the system SMS composer prefilled with recipients and a message.",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "expo-sms wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Opens the system SMS composer prefilled with recipients and a message.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -23,12 +23,20 @@
|
|
|
23
23
|
"default": "./build/core/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./vue": {
|
|
26
|
-
"types": "./build/
|
|
27
|
-
"default": "./build/
|
|
26
|
+
"types": "./build/core/index.d.ts",
|
|
27
|
+
"default": "./build/core/index.js"
|
|
28
28
|
},
|
|
29
29
|
"./react": {
|
|
30
|
-
"types": "./build/
|
|
31
|
-
"default": "./build/
|
|
30
|
+
"types": "./build/core/index.d.ts",
|
|
31
|
+
"default": "./build/core/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./svelte": {
|
|
34
|
+
"types": "./build/core/index.d.ts",
|
|
35
|
+
"default": "./build/core/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./solid": {
|
|
38
|
+
"types": "./build/core/index.d.ts",
|
|
39
|
+
"default": "./build/core/index.js"
|
|
32
40
|
},
|
|
33
41
|
"./angular": {
|
|
34
42
|
"types": "./build-ngc/angular/index.d.ts",
|
|
@@ -53,15 +61,19 @@
|
|
|
53
61
|
"expo-modules-core": "57.0.5"
|
|
54
62
|
},
|
|
55
63
|
"peerDependencies": {
|
|
64
|
+
"@symbiote-native/angular": ">=0.6.2",
|
|
56
65
|
"@symbiote-native/engine": ">=0.1.7",
|
|
66
|
+
"@symbiote-native/react": ">=0.2.8",
|
|
67
|
+
"@symbiote-native/solid": ">=0.0.1",
|
|
68
|
+
"@symbiote-native/svelte": ">=0.1.0",
|
|
69
|
+
"@symbiote-native/vue": ">=0.3.8",
|
|
57
70
|
"@angular/core": ">=20",
|
|
58
71
|
"@vue/runtime-core": "^3.5.13",
|
|
59
72
|
"react": ">=19.0.0",
|
|
60
73
|
"react-native": ">=0.86",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"@symbiote-native/vue": "0.3.8"
|
|
74
|
+
"solid-js": ">=1.9.0",
|
|
75
|
+
"svelte": ">=5.56.0",
|
|
76
|
+
"vue": ">=3.5.0"
|
|
65
77
|
},
|
|
66
78
|
"peerDependenciesMeta": {
|
|
67
79
|
"@symbiote-native/angular": {
|
|
@@ -70,6 +82,12 @@
|
|
|
70
82
|
"@symbiote-native/react": {
|
|
71
83
|
"optional": true
|
|
72
84
|
},
|
|
85
|
+
"@symbiote-native/solid": {
|
|
86
|
+
"optional": true
|
|
87
|
+
},
|
|
88
|
+
"@symbiote-native/svelte": {
|
|
89
|
+
"optional": true
|
|
90
|
+
},
|
|
73
91
|
"@symbiote-native/vue": {
|
|
74
92
|
"optional": true
|
|
75
93
|
},
|
|
@@ -82,24 +100,34 @@
|
|
|
82
100
|
"react": {
|
|
83
101
|
"optional": true
|
|
84
102
|
},
|
|
103
|
+
"solid-js": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"svelte": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
85
109
|
"vue": {
|
|
86
110
|
"optional": true
|
|
87
111
|
}
|
|
88
112
|
},
|
|
89
113
|
"devDependencies": {
|
|
90
|
-
"@angular/compiler": "
|
|
91
|
-
"@angular/compiler-cli": "
|
|
92
|
-
"@angular/core": "
|
|
114
|
+
"@angular/compiler": "~22.0.8",
|
|
115
|
+
"@angular/compiler-cli": "~22.0.8",
|
|
116
|
+
"@angular/core": "~22.0.8",
|
|
93
117
|
"@types/node": "^26.0.0",
|
|
94
118
|
"@types/react": "^19.2.0",
|
|
95
119
|
"@vue/runtime-core": "^3.5.13",
|
|
96
120
|
"react": "19.2.3",
|
|
121
|
+
"solid-js": "^1.9.14",
|
|
122
|
+
"svelte": "^5.56.0",
|
|
97
123
|
"typescript": "~6.0.0",
|
|
98
|
-
"@symbiote-native/angular": "0.
|
|
99
|
-
"@symbiote-native/engine": "0.
|
|
100
|
-
"@symbiote-native/react": "0.
|
|
101
|
-
"@symbiote-native/
|
|
102
|
-
"@symbiote-native/
|
|
124
|
+
"@symbiote-native/angular": "0.8.0",
|
|
125
|
+
"@symbiote-native/engine": "0.3.0",
|
|
126
|
+
"@symbiote-native/react": "0.4.0",
|
|
127
|
+
"@symbiote-native/solid": "0.1.0",
|
|
128
|
+
"@symbiote-native/svelte": "0.3.0",
|
|
129
|
+
"@symbiote-native/test-utils": "0.2.0",
|
|
130
|
+
"@symbiote-native/vue": "0.5.0"
|
|
103
131
|
},
|
|
104
132
|
"scripts": {
|
|
105
133
|
"typecheck": "tsc --build",
|
package/src/core/index.ts
CHANGED
package/src/core/sms.ts
CHANGED
|
@@ -57,7 +57,11 @@ export async function sendSMSAsync(
|
|
|
57
57
|
return expoSms.sendSMSAsync(recipients, message, nativeOptions);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
function normalizeAttachments(
|
|
60
|
+
function normalizeAttachments(
|
|
61
|
+
attachments: ISmsAttachment | ISmsAttachment[],
|
|
62
|
+
): ISmsAttachment[] {
|
|
61
63
|
const list = Array.isArray(attachments) ? attachments : [attachments];
|
|
62
|
-
return Platform.OS === 'android'
|
|
64
|
+
return Platform.OS === 'android'
|
|
65
|
+
? list.slice(0, ANDROID_ATTACHMENT_LIMIT)
|
|
66
|
+
: list;
|
|
63
67
|
}
|
package/build/react/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/react/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/sms/react: the React entry over the framework-agnostic core.
|
|
2
|
-
// Both exports are stateless free functions — `sendSMSAsync` resolves once the system composer
|
|
3
|
-
// closes and holds nothing afterwards, and there is no event stream to subscribe to — so there
|
|
4
|
-
// is nothing for a hook to own or clean up. Plain re-export, the same shape
|
|
5
|
-
// packages/secure-store's React entry has for the same reason.
|
|
6
|
-
export * from '../core/index.js';
|
package/build/vue/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/vue/index.js
DELETED
package/src/react/index.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/sms/react: the React entry over the framework-agnostic core.
|
|
2
|
-
// Both exports are stateless free functions — `sendSMSAsync` resolves once the system composer
|
|
3
|
-
// closes and holds nothing afterwards, and there is no event stream to subscribe to — so there
|
|
4
|
-
// is nothing for a hook to own or clean up. Plain re-export, the same shape
|
|
5
|
-
// packages/secure-store's React entry has for the same reason.
|
|
6
|
-
export * from '../core';
|
package/src/vue/index.ts
DELETED