web-launch-kit 0.0.6 → 0.0.7
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.ko.md +11 -4
- package/README.md +13 -5
- package/dist/index.d.ts +1 -0
- package/dist/launch-kit.cjs +5 -3
- package/dist/launch-kit.cjs.map +1 -1
- package/dist/launch-kit.min.cjs +1 -1
- package/dist/launch-kit.min.cjs.map +1 -1
- package/dist/launch-kit.min.mjs +1 -1
- package/dist/launch-kit.min.mjs.map +1 -1
- package/dist/launch-kit.mjs +5 -3
- package/dist/launch-kit.mjs.map +1 -1
- package/dist/launch-kit.umd.js +5 -3
- package/dist/launch-kit.umd.js.map +1 -1
- package/dist/launch-kit.umd.min.js +1 -1
- package/dist/launch-kit.umd.min.js.map +1 -1
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -119,10 +119,10 @@ flowchart TD
|
|
|
119
119
|
A1{"intent given, but scheme /<br/>packageName / fallback missing?"}
|
|
120
120
|
A1 -->|yes| A2["parseIntentURL:<br/>derive scheme · packageName · fallback"]
|
|
121
121
|
A1 -->|no| A3
|
|
122
|
-
A2 --> A3{"scheme given
|
|
122
|
+
A2 --> A3{"allowIntent, and scheme given<br/>but intent missing?"}
|
|
123
123
|
A3 -->|yes| A4["createIntentURL:<br/>scheme + packageName + fallback"]
|
|
124
124
|
A3 -->|no| A5
|
|
125
|
-
A4 --> A5["Priority list:<br/>intent (if canOpenIntent) ⭢ scheme (if canOpenScheme)<br/>⭢ fallback ⭢ app store (if canOpenScheme) ⭢ web store"]
|
|
125
|
+
A4 --> A5["Priority list:<br/>intent (if allowIntent and canOpenIntent) ⭢ scheme (if canOpenScheme)<br/>⭢ fallback ⭢ app store (if canOpenScheme) ⭢ web store"]
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
subgraph IOS["ios · resolveOptions"]
|
|
@@ -202,8 +202,8 @@ const openedBy = await LaunchKit.app({
|
|
|
202
202
|
console.log(openedBy) // "universal" | "scheme" | "intent" | "fallback" | "store"
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
플랫폼별 필드: 안드로이드는 `intent` / `scheme` / `packageName` / `fallback`
|
|
206
|
-
서로에게서 유도됩니다), iOS는 `universal` / `scheme` / `bundleId` / `trackId`, Windows는
|
|
205
|
+
플랫폼별 필드: 안드로이드는 `intent` / `scheme` / `packageName` / `fallback` /
|
|
206
|
+
`allowIntent`(scheme ⇄ intent는 서로에게서 유도됩니다), iOS는 `universal` / `scheme` / `bundleId` / `trackId`, Windows는
|
|
207
207
|
`scheme` / `packageFamilyName` / `productId`, macOS는 `scheme` / `bundleId` / `trackId`를
|
|
208
208
|
받습니다. 모두 `fallback`, `timeout`, `allowAppStore`, `allowWebStore`를 함께 받습니다.
|
|
209
209
|
|
|
@@ -333,6 +333,13 @@ if (LaunchKit.utils.canOpenSetting) {
|
|
|
333
333
|
그리고 파트너가 아닌 웨이보) 안에서는 커스텀 스킴·`intent://`·`market://` 같은 스토어 스킴이
|
|
334
334
|
타임아웃을 소진하지 않고 미리 제외됩니다. 그래서 체인이 곧바로 `fallback` / 웹스토어로
|
|
335
335
|
떨어집니다. 화이트리스트에 등록된 파트너 앱은 `assumeAllowedInApp: true`로 되돌립니다.
|
|
336
|
+
- **`allowIntent: false`는 안드로이드의 `intent://` 경로를 제외합니다.** 유도된 `intent://`에는
|
|
337
|
+
`S.browser_fallback_url`이 실립니다 — `fallback`에 URL을 주면 그 URL, 아니면 `packageName`이
|
|
338
|
+
있을 때 스토어입니다. 그래서 그 이동은 브라우저가 첫 시도 안에서 직접 처리합니다. 앱이 없는
|
|
339
|
+
사용자를 스토어로 보내는 가장 빠른 경로지만, 동시에 첫 시도가 항상 어딘가에 도달하므로 그
|
|
340
|
+
뒤의 순수 스킴은 실행되지 않습니다. `allowIntent: false`로 이 경로를 아예 건너뛰면 순서를
|
|
341
|
+
체인이 결정합니다 — 스킴, `fallback`, 그리고 허용한 스토어 순입니다. 직접 넘긴 `intent`도 같이
|
|
342
|
+
제외되지만, 거기서 파싱한 scheme·`packageName`·`fallback`은 그대로 사용됩니다.
|
|
336
343
|
- **`map()`은 각 후보에 OS별 타임아웃**을 사용하고, `app()`처럼 성공한 경로를 반환합니다.
|
|
337
344
|
- **웹 폴백은 내비게이션 시점에 resolve합니다.** `fallback`이나 웹스토어 후보는 문서 자체를
|
|
338
345
|
교체하므로 기다릴 앱 전환이 없습니다. 이동을 시작하는 즉시 resolve하며, 이동이 성공한 뒤에
|
package/README.md
CHANGED
|
@@ -120,10 +120,10 @@ flowchart TD
|
|
|
120
120
|
A1{"intent given, but scheme /<br/>packageName / fallback missing?"}
|
|
121
121
|
A1 -->|yes| A2["parseIntentURL:<br/>derive scheme · packageName · fallback"]
|
|
122
122
|
A1 -->|no| A3
|
|
123
|
-
A2 --> A3{"scheme given
|
|
123
|
+
A2 --> A3{"allowIntent, and scheme given<br/>but intent missing?"}
|
|
124
124
|
A3 -->|yes| A4["createIntentURL:<br/>scheme + packageName + fallback"]
|
|
125
125
|
A3 -->|no| A5
|
|
126
|
-
A4 --> A5["Priority list:<br/>intent (if canOpenIntent) ⭢ scheme (if canOpenScheme)<br/>⭢ fallback ⭢ app store (if canOpenScheme) ⭢ web store"]
|
|
126
|
+
A4 --> A5["Priority list:<br/>intent (if allowIntent and canOpenIntent) ⭢ scheme (if canOpenScheme)<br/>⭢ fallback ⭢ app store (if canOpenScheme) ⭢ web store"]
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
subgraph IOS["ios · resolveOptions"]
|
|
@@ -203,8 +203,8 @@ const openedBy = await LaunchKit.app({
|
|
|
203
203
|
console.log(openedBy) // "universal" | "scheme" | "intent" | "fallback" | "store"
|
|
204
204
|
```
|
|
205
205
|
|
|
206
|
-
Per-platform fields: Android accepts `intent` / `scheme` / `packageName` / `fallback`
|
|
207
|
-
(scheme ⇄ intent are derived from each other); iOS accepts `universal` / `scheme` /
|
|
206
|
+
Per-platform fields: Android accepts `intent` / `scheme` / `packageName` / `fallback` /
|
|
207
|
+
`allowIntent` (scheme ⇄ intent are derived from each other); iOS accepts `universal` / `scheme` /
|
|
208
208
|
`bundleId` / `trackId`; Windows accepts `scheme` / `packageFamilyName` / `productId`;
|
|
209
209
|
macOS accepts `scheme` / `bundleId` / `trackId`. All accept `fallback`, `timeout`,
|
|
210
210
|
`allowAppStore`, `allowWebStore`.
|
|
@@ -216,7 +216,7 @@ UI — there is otherwise nothing on screen for the length of the timeout.
|
|
|
216
216
|
await LaunchKit.app({
|
|
217
217
|
android: { scheme: 'myapp://profile/42', packageName: 'com.example.myapp', allowWebStore: true },
|
|
218
218
|
onAttempt({ by, index, total }) {
|
|
219
|
-
setStatus(by === 'store' ? '
|
|
219
|
+
setStatus(by === 'store' ? 'Go to the store' : 'Opening the app… (' + (index + 1) + '/' + total + ')')
|
|
220
220
|
},
|
|
221
221
|
})
|
|
222
222
|
```
|
|
@@ -338,6 +338,14 @@ if (LaunchKit.utils.canOpenSetting) {
|
|
|
338
338
|
burning their timeouts, so the chain falls straight through to `fallback` / web store
|
|
339
339
|
(the only routes that work there). Whitelisted partner apps opt back in with
|
|
340
340
|
`assumeAllowedInApp: true`.
|
|
341
|
+
- **`allowIntent: false` drops the Android `intent://` route.** A derived `intent://` carries
|
|
342
|
+
`S.browser_fallback_url` — your `fallback` when you gave a URL, otherwise the store when a
|
|
343
|
+
`packageName` is present — so the browser handles that hop itself during the first attempt.
|
|
344
|
+
That is the fastest route to the store for a user without the app, but it also means the
|
|
345
|
+
first attempt always lands somewhere, and the plain scheme behind it never runs. Set
|
|
346
|
+
`allowIntent: false` to skip the route entirely and let the chain decide the order: scheme,
|
|
347
|
+
then `fallback`, then the store you allowed. An explicit `intent` is gated too, though the
|
|
348
|
+
scheme, `packageName` and `fallback` parsed out of it are still used.
|
|
341
349
|
- **`map()` uses the per-OS timeout** for each candidate, and resolves with the route that
|
|
342
350
|
worked just like `app()`.
|
|
343
351
|
- **Web fallbacks resolve on navigation.** A `fallback` or web-store candidate replaces the
|
package/dist/index.d.ts
CHANGED
package/dist/launch-kit.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version$3 = "0.0.
|
|
5
|
+
var version$3 = "0.0.7";
|
|
6
6
|
var packageJSON$3 = {
|
|
7
7
|
version: version$3};
|
|
8
8
|
|
|
@@ -2347,6 +2347,7 @@ function resolveOptions(option) {
|
|
|
2347
2347
|
var timeout;
|
|
2348
2348
|
var intent;
|
|
2349
2349
|
var packageName;
|
|
2350
|
+
var allowIntent = true;
|
|
2350
2351
|
var bundleId;
|
|
2351
2352
|
var trackId;
|
|
2352
2353
|
var universal;
|
|
@@ -2356,6 +2357,7 @@ function resolveOptions(option) {
|
|
|
2356
2357
|
case 'android':
|
|
2357
2358
|
if (typeof option.android === 'undefined')
|
|
2358
2359
|
return [[], 0];
|
|
2360
|
+
allowIntent = option.android.allowIntent !== false;
|
|
2359
2361
|
intent = stripURL(option.android.intent);
|
|
2360
2362
|
scheme = stripURL(option.android.scheme);
|
|
2361
2363
|
fallback = stripURL(option.android.fallback);
|
|
@@ -2374,11 +2376,11 @@ function resolveOptions(option) {
|
|
|
2374
2376
|
if (typeof parsed.fallback !== 'undefined' && typeof fallback === 'undefined')
|
|
2375
2377
|
fallback = parsed.fallback;
|
|
2376
2378
|
}
|
|
2377
|
-
if (typeof scheme !== 'undefined' && typeof intent === 'undefined')
|
|
2379
|
+
if (allowIntent && typeof scheme !== 'undefined' && typeof intent === 'undefined')
|
|
2378
2380
|
intent = createIntentURL(scheme, packageName, fallback);
|
|
2379
2381
|
if (typeof timeout === 'undefined')
|
|
2380
2382
|
timeout = ANDROID_DEFAULT_TIMEOUT;
|
|
2381
|
-
if (typeof intent !== 'undefined' && canOpenIntent())
|
|
2383
|
+
if (allowIntent && typeof intent !== 'undefined' && canOpenIntent())
|
|
2382
2384
|
resolved.push(['intent', intent]);
|
|
2383
2385
|
if (typeof scheme !== 'undefined' && allowScheme)
|
|
2384
2386
|
resolved.push(['scheme', scheme]);
|