@doorstepai/dropoff-sdk 2.1.2 → 2.2.2
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 +66 -0
- package/README.md +308 -41
- package/android/build.gradle +5 -1
- package/android/src/main/java/com/doorstepai/dropoffsdk/DoorstepAIModule.kt +566 -2
- package/ios/DoorstepAI.mm +12 -2
- package/ios/DoorstepAI.swift +151 -2
- package/ios/DoorstepDropoffSDK.xcframework/Info.plist +5 -5
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.abi.json +10582 -5745
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +95 -4
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.swiftinterface +95 -4
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/_CodeSignature/CodeResources +10 -10
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/DWARF/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/DoorstepDropoffSDK.yml +3833 -2687
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +10582 -5745
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +95 -4
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +95 -4
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +10582 -5745
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +95 -4
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +95 -4
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/_CodeSignature/CodeResources +20 -20
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/DWARF/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/DoorstepDropoffSDK.yml +3833 -2687
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/DoorstepDropoffSDK.yml +3802 -2674
- package/lib/module/DoorstepAI.js +425 -12
- package/lib/module/DoorstepAI.js.map +1 -1
- package/lib/module/RootDoorstepAI.js +88 -26
- package/lib/module/RootDoorstepAI.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/DoorstepAI.d.ts +349 -7
- package/lib/typescript/src/DoorstepAI.d.ts.map +1 -1
- package/lib/typescript/src/RootDoorstepAI.d.ts +31 -3
- package/lib/typescript/src/RootDoorstepAI.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/DoorstepAI.tsx +575 -23
- package/src/RootDoorstepAI.tsx +130 -47
- package/src/index.tsx +10 -0
|
@@ -1,44 +1,106 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { requireNativeComponent, View, Platform, StyleSheet,
|
|
3
|
+
import { requireNativeComponent, View, Platform, StyleSheet, AppState } from 'react-native';
|
|
4
4
|
import { useEffect } from 'react';
|
|
5
5
|
import { DoorstepAI } from "./DoorstepAI.js";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
const DoorstepAIView = requireNativeComponent('RootDoorstepAIView');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Drop-in bootstrap: mount it once, near the root, and it runs the SDK's
|
|
11
|
+
* `init` + `setApiKey` and the permission sequence for you. Everything it does is
|
|
12
|
+
* available a la carte on {@link DoorstepAI} — this component exists so a host
|
|
13
|
+
* that just wants the default flow does not have to write it.
|
|
14
|
+
*/
|
|
8
15
|
export function RootDoorstepAI(props) {
|
|
16
|
+
const {
|
|
17
|
+
apiKey,
|
|
18
|
+
notificationTitle,
|
|
19
|
+
notificationText,
|
|
20
|
+
permissions,
|
|
21
|
+
requestBluetooth,
|
|
22
|
+
requestBackgroundLocation
|
|
23
|
+
} = props;
|
|
9
24
|
useEffect(() => {
|
|
25
|
+
let cancelled = false;
|
|
26
|
+
let backgroundPhaseSettled = false;
|
|
27
|
+
|
|
28
|
+
// The effective whitelist. `permissions` wins; `requestBluetooth: false` is
|
|
29
|
+
// expressed as "every bucket except this platform's BLE one", which is what
|
|
30
|
+
// the old two-boolean requester meant by it.
|
|
31
|
+
const whitelist = permissions ?? (requestBluetooth === false ? DoorstepAI.allPermissionBuckets().filter(bucket => bucket !== 'bluetooth' && bucket !== 'bluetoothScan') : undefined);
|
|
32
|
+
|
|
33
|
+
// Whether background location is ours to ask for at all: the host can turn the
|
|
34
|
+
// phase off, and a whitelist that does not name the bucket must not have it
|
|
35
|
+
// added back behind the host's back.
|
|
36
|
+
const backgroundInScope = requestBackgroundLocation !== false && (whitelist == null || whitelist.some(p => p === 'locationAlways' || p === 'location'));
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Phase 2. `locationAlways` is only ever asked ALONE and only after foreground
|
|
40
|
+
* location is granted — the SDK enforces both rules and reports a refusal to
|
|
41
|
+
* ask rather than asking anyway, so this can be called optimistically. It is
|
|
42
|
+
* re-run on each foreground because on Android the foreground grant result is
|
|
43
|
+
* delivered to the Activity, not to JS.
|
|
44
|
+
*/
|
|
45
|
+
const runBackgroundLocationPhase = async () => {
|
|
46
|
+
if (cancelled || backgroundPhaseSettled || !backgroundInScope) return;
|
|
47
|
+
try {
|
|
48
|
+
const {
|
|
49
|
+
statuses
|
|
50
|
+
} = await DoorstepAI.checkPermissions(['locationWhenInUse', 'locationAlways']);
|
|
51
|
+
const always = statuses.locationAlways?.state;
|
|
52
|
+
if (always === 'granted') {
|
|
53
|
+
backgroundPhaseSettled = true;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
// Foreground first: asking earlier spends the request on an automatic
|
|
57
|
+
// denial (Android) or shows the wrong prompt (iOS).
|
|
58
|
+
if (statuses.locationWhenInUse?.state !== 'granted') return;
|
|
59
|
+
// On iOS `whenInUseOnly` is a deliberate user choice and the SDK declines
|
|
60
|
+
// to re-prompt for it; the call is still made because native is the right
|
|
61
|
+
// place for that decision, and it comes back `deferred` rather than
|
|
62
|
+
// prompting.
|
|
63
|
+
backgroundPhaseSettled = true;
|
|
64
|
+
await DoorstepAI.requestPermissions(['locationAlways']);
|
|
65
|
+
} catch (err) {
|
|
66
|
+
console.warn('DOORSTEPAI - background location request failed:', err);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// Registered synchronously so the effect cleanup always has it to remove.
|
|
71
|
+
const appStateSubscription = AppState.addEventListener('change', state => {
|
|
72
|
+
if (state === 'active') runBackgroundLocationPhase();
|
|
73
|
+
});
|
|
10
74
|
const initializeAndRequestPermissions = async () => {
|
|
11
75
|
if (Platform.OS === 'android') {
|
|
12
|
-
await DoorstepAI.init(
|
|
76
|
+
await DoorstepAI.init(notificationTitle || '', notificationText || '');
|
|
13
77
|
}
|
|
14
|
-
DoorstepAI.setApiKey(
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
console.warn('Error requesting Android permissions:', err);
|
|
30
|
-
}
|
|
31
|
-
} else if (Platform.OS === 'ios') {
|
|
32
|
-
console.log('iOS: Ensure location and motion usage descriptions are in Info.plist');
|
|
33
|
-
// Opt-in Bluetooth: triggers the iOS BT prompt (needs
|
|
34
|
-
// NSBluetoothAlwaysUsageDescription in the host Info.plist).
|
|
35
|
-
if (props.requestBluetooth) {
|
|
36
|
-
DoorstepAI.requestAllPermissions(true, true);
|
|
78
|
+
DoorstepAI.setApiKey(apiKey);
|
|
79
|
+
if (cancelled) return;
|
|
80
|
+
try {
|
|
81
|
+
// One requester for both platforms; native dispatches. Safe at launch on
|
|
82
|
+
// iOS only because native defaults `onlyIfNotDetermined` to true: an
|
|
83
|
+
// already-answered permission is left alone, so this cannot re-escalate a
|
|
84
|
+
// user's "While Using the App" choice on every launch.
|
|
85
|
+
const {
|
|
86
|
+
statuses
|
|
87
|
+
} = await DoorstepAI.requestPermissions(whitelist);
|
|
88
|
+
if (cancelled) return;
|
|
89
|
+
// Resolves only once the user has ANSWERED, so this state is final and
|
|
90
|
+
// phase 2 can run straight away instead of waiting for the next foreground.
|
|
91
|
+
if (statuses.locationWhenInUse?.state === 'granted') {
|
|
92
|
+
await runBackgroundLocationPhase();
|
|
37
93
|
}
|
|
94
|
+
} catch (err) {
|
|
95
|
+
console.warn('DOORSTEPAI - permission request failed:', err);
|
|
38
96
|
}
|
|
39
97
|
};
|
|
40
98
|
initializeAndRequestPermissions();
|
|
41
|
-
|
|
99
|
+
return () => {
|
|
100
|
+
cancelled = true;
|
|
101
|
+
appStateSubscription.remove();
|
|
102
|
+
};
|
|
103
|
+
}, [apiKey, notificationTitle, notificationText, permissions, requestBluetooth, requestBackgroundLocation]);
|
|
42
104
|
|
|
43
105
|
// On iOS, the native view might handle triggering permission prompts if needed.
|
|
44
106
|
// The main setup involves Info.plist configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["requireNativeComponent","View","Platform","StyleSheet","
|
|
1
|
+
{"version":3,"names":["requireNativeComponent","View","Platform","StyleSheet","AppState","useEffect","DoorstepAI","jsx","_jsx","DoorstepAIView","RootDoorstepAI","props","apiKey","notificationTitle","notificationText","permissions","requestBluetooth","requestBackgroundLocation","cancelled","backgroundPhaseSettled","whitelist","allPermissionBuckets","filter","bucket","undefined","backgroundInScope","some","p","runBackgroundLocationPhase","statuses","checkPermissions","always","locationAlways","state","locationWhenInUse","requestPermissions","err","console","warn","appStateSubscription","addEventListener","initializeAndRequestPermissions","OS","init","setApiKey","remove","style","styles","container","children","create","height","width"],"sourceRoot":"../../src","sources":["RootDoorstepAI.tsx"],"mappings":";;AAAA,SACEA,sBAAsB,EACtBC,IAAI,EACJC,QAAQ,EACRC,UAAU,EACVC,QAAQ,QACH,cAAc;AAErB,SAASC,SAAS,QAAQ,OAAO;AAEjC,SAASC,UAAU,QAAQ,iBAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG1C,MAAMC,cAAc,GAAGT,sBAAsB,CAAC,oBAAoB,CAAC;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,cAAcA,CAACC,KA4B9B,EAAE;EACD,MAAM;IACJC,MAAM;IACNC,iBAAiB;IACjBC,gBAAgB;IAChBC,WAAW;IACXC,gBAAgB;IAChBC;EACF,CAAC,GAAGN,KAAK;EAETN,SAAS,CAAC,MAAM;IACd,IAAIa,SAAS,GAAG,KAAK;IACrB,IAAIC,sBAAsB,GAAG,KAAK;;IAElC;IACA;IACA;IACA,MAAMC,SAAgD,GACpDL,WAAW,KACVC,gBAAgB,KAAK,KAAK,GACvBV,UAAU,CAACe,oBAAoB,CAAC,CAAC,CAACC,MAAM,CACrCC,MAAM,IAAKA,MAAM,KAAK,WAAW,IAAIA,MAAM,KAAK,eACnD,CAAC,GACDC,SAAS,CAAC;;IAEhB;IACA;IACA;IACA,MAAMC,iBAAiB,GACrBR,yBAAyB,KAAK,KAAK,KAClCG,SAAS,IAAI,IAAI,IAChBA,SAAS,CAACM,IAAI,CAAEC,CAAC,IAAKA,CAAC,KAAK,gBAAgB,IAAIA,CAAC,KAAK,UAAU,CAAC,CAAC;;IAEtE;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,MAAMC,0BAA0B,GAAG,MAAAA,CAAA,KAAY;MAC7C,IAAIV,SAAS,IAAIC,sBAAsB,IAAI,CAACM,i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;UACnD,MAAML,0BAA0B,CAAC,CAAC;QACpC;MACF,CAAC,CAAC,OAAOQ,GAAG,EAAE;QACZC,OAAO,CAACC,IAAI,CAAC,yCAAyC,EAAEF,GAAG,CAAC;MAC9D;IACF,CAAC;IAEDK,+BAA+B,CAAC,CAAC;IAEjC,OAAO,MAAM;MACXvB,SAAS,GAAG,IAAI;MAChBqB,oBAAoB,CAACM,MAAM,CAAC,CAAC;IAC/B,CAAC;EACH,CAAC,EAAE,CACDjC,MAAM,EACNC,iBAAiB,EACjBC,gBAAgB,EAChBC,WAAW,EACXC,gBAAgB,EAChBC,yBAAyB,CAC1B,CAAC;;EAEF;EACA;EACA,oBACET,IAAA,CAACP,IAAI;IAAC6C,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,EAC3B/C,QAAQ,CAACwC,EAAE,KAAK,KAAK,gBAAGlC,IAAA,CAACC,cAAc,IAAE,CAAC,GAAG;EAAI,CAC9C,CAAC;AAEX;AAEA,MAAMsC,MAAM,GAAG5C,UAAU,CAAC+C,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RootDoorstepAI","DoorstepAI"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,qBAAkB;AACjD,SAASC,UAAU,QAAQ,iBAAc;
|
|
1
|
+
{"version":3,"names":["RootDoorstepAI","DoorstepAI"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,qBAAkB;AACjD,SAASC,UAAU,QAAQ,iBAAc;AAsBzC,SAASA,UAAU,EAAED,cAAc","ignoreList":[]}
|
|
@@ -53,8 +53,12 @@ type GeofenceSessionEvent = {
|
|
|
53
53
|
type StartDeliveryOptions = {
|
|
54
54
|
/**
|
|
55
55
|
* Hard upper bound on the delivery's tracking session in seconds. When the
|
|
56
|
-
* timer fires the SDK calls `stopDelivery` automatically.
|
|
57
|
-
*
|
|
56
|
+
* timer fires the SDK calls `stopDelivery` automatically.
|
|
57
|
+
*
|
|
58
|
+
* Omit it for NO backstop — that is the native behaviour on both platforms.
|
|
59
|
+
* This wrapper used to substitute 3600 s here, which silently force-stopped
|
|
60
|
+
* every delivery at one hour and re-created a bug the native SDK had already
|
|
61
|
+
* removed. It now passes your value through untouched.
|
|
58
62
|
*/
|
|
59
63
|
timeoutSeconds?: number;
|
|
60
64
|
/**
|
|
@@ -81,6 +85,175 @@ type StartDeliveryOptions = {
|
|
|
81
85
|
*/
|
|
82
86
|
driverId?: string;
|
|
83
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* A runtime-permission **bucket** — one bucket is one user-visible OS decision,
|
|
90
|
+
* spelled exactly as the native SDK spells it.
|
|
91
|
+
*
|
|
92
|
+
* The buckets are deliberately OS-specific, because the platforms are: iOS has a
|
|
93
|
+
* single Motion & Fitness authorization and no WiFi-scan permission at all,
|
|
94
|
+
* Android splits BLE scanning, nearby-WiFi and notifications into their own
|
|
95
|
+
* dialogs. Only the two location buckets exist on both.
|
|
96
|
+
*
|
|
97
|
+
* | bucket | iOS | Android |
|
|
98
|
+
* |---|---|---|
|
|
99
|
+
* | `locationWhenInUse` | `requestWhenInUseAuthorization` | `ACCESS_FINE_LOCATION` + `ACCESS_COARSE_LOCATION` |
|
|
100
|
+
* | `locationAlways` | `requestAlwaysAuthorization` | `ACCESS_BACKGROUND_LOCATION` |
|
|
101
|
+
* | `motionFitness` | Motion & Fitness | — (use `activityRecognition`) |
|
|
102
|
+
* | `activityRecognition` | — (use `motionFitness`) | `ACTIVITY_RECOGNITION` |
|
|
103
|
+
* | `bluetooth` | `CBCentralManager` | — (use `bluetoothScan`) |
|
|
104
|
+
* | `bluetoothScan` | — (use `bluetooth`) | `BLUETOOTH_SCAN` (API 31+) |
|
|
105
|
+
* | `nearbyWifiDevices` | — | `NEARBY_WIFI_DEVICES` (API 33+) |
|
|
106
|
+
* | `notifications` | — | `POST_NOTIFICATIONS` (API 33+) |
|
|
107
|
+
*
|
|
108
|
+
* You may pass **either platform's** name on either platform: the wrapper
|
|
109
|
+
* translates the counterpart bucket (`motionFitness` ⇄ `activityRecognition`,
|
|
110
|
+
* `bluetooth` ⇄ `bluetoothScan`) so one whitelist works on both without a
|
|
111
|
+
* `Platform.OS` branch. A bucket with no counterpart at all (`nearbyWifiDevices`
|
|
112
|
+
* / `notifications` on iOS) is reported back in `unsupported` rather than
|
|
113
|
+
* silently dropped.
|
|
114
|
+
*/
|
|
115
|
+
type DoorstepPermission = 'locationWhenInUse' | 'locationAlways' | 'motionFitness' | 'bluetooth' | 'activityRecognition' | 'bluetoothScan' | 'nearbyWifiDevices' | 'notifications';
|
|
116
|
+
/**
|
|
117
|
+
* Coarse aliases accepted anywhere a {@link DoorstepPermission} is, kept because
|
|
118
|
+
* they are what the published 2.x wrapper API took. Each expands to this
|
|
119
|
+
* platform's buckets: `location` → both location buckets, `motion` / `activity`
|
|
120
|
+
* → the platform's motion bucket, `bluetooth` → the platform's BLE bucket
|
|
121
|
+
* (`bluetooth` is also a real iOS bucket name, so it is both).
|
|
122
|
+
*/
|
|
123
|
+
type DoorstepPermissionAlias = 'location' | 'motion' | 'activity';
|
|
124
|
+
/** Anything the whitelist accepts. */
|
|
125
|
+
type DoorstepPermissionInput = DoorstepPermission | DoorstepPermissionAlias;
|
|
126
|
+
/**
|
|
127
|
+
* The state of one bucket. Eight states, **identical names on both platforms**,
|
|
128
|
+
* so host code branches once.
|
|
129
|
+
*
|
|
130
|
+
* - `granted` — held right now.
|
|
131
|
+
* - `notDetermined` — never asked; a request will show a dialog.
|
|
132
|
+
* - `whenInUseOnly` — **load-bearing.** Foreground location held, background not
|
|
133
|
+
* (iOS "While Using the App" / Android foreground-only). Only ever reported for
|
|
134
|
+
* `locationAlways`. Never treat it as `granted`: background collection and
|
|
135
|
+
* route geofencing do not work in it.
|
|
136
|
+
* - `denied` — refused, but another prompt is still possible. Android only; iOS
|
|
137
|
+
* refusals are always final.
|
|
138
|
+
* - `permanentlyDenied` — refused with no further prompt possible. Deep-link the
|
|
139
|
+
* user to Settings. Every iOS refusal lands here.
|
|
140
|
+
* - `restricted` — blocked by device policy / MDM / Screen Time.
|
|
141
|
+
* - `unavailable` — the OS version or the hardware does not have it. Not a
|
|
142
|
+
* failure, nothing to request.
|
|
143
|
+
* - `notDeclared` — **the HOST BUILD is missing the declaration**
|
|
144
|
+
* (`<uses-permission>` on Android, an `NS…UsageDescription` key on iOS), so the
|
|
145
|
+
* OS would never show a dialog. Fixable by you; it is NOT a user refusal.
|
|
146
|
+
*/
|
|
147
|
+
type DoorstepPermissionState = 'granted' | 'notDetermined' | 'whenInUseOnly' | 'denied' | 'permanentlyDenied' | 'restricted' | 'unavailable' | 'notDeclared';
|
|
148
|
+
/** The evaluated state of one bucket. */
|
|
149
|
+
type DoorstepPermissionStatus = {
|
|
150
|
+
permission: DoorstepPermission;
|
|
151
|
+
state: DoorstepPermissionState;
|
|
152
|
+
/**
|
|
153
|
+
* Raw evidence in the OS's own vocabulary (`"authorizedWhenInUse"`,
|
|
154
|
+
* `"ACCESS_FINE_LOCATION=granted,ACCESS_COARSE_LOCATION=denied"`, …).
|
|
155
|
+
* Diagnostic only — never branch on it.
|
|
156
|
+
*/
|
|
157
|
+
osStatus: string;
|
|
158
|
+
/** True when `requestPermissions` would actually raise a dialog for it. */
|
|
159
|
+
canRequest: boolean;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* The grant state of one permission in the **legacy** three-value vocabulary the
|
|
163
|
+
* published 2.x wrapper API used. `'prompt'` means "not determined yet".
|
|
164
|
+
*
|
|
165
|
+
* @deprecated Read {@link PermissionStatus.statuses} instead — it distinguishes
|
|
166
|
+
* `whenInUseOnly`, `permanentlyDenied` and `notDeclared`, all of which collapse
|
|
167
|
+
* away here.
|
|
168
|
+
*/
|
|
169
|
+
type PermissionState = 'granted' | 'denied' | 'prompt';
|
|
170
|
+
/**
|
|
171
|
+
* The three coarse domains of the legacy view.
|
|
172
|
+
*
|
|
173
|
+
* @deprecated Use {@link DoorstepPermission}.
|
|
174
|
+
*/
|
|
175
|
+
type DoorstepPermissionType = 'location' | 'motion' | 'bluetooth';
|
|
176
|
+
/** What {@link DoorstepAIModule.checkPermissions} answers. */
|
|
177
|
+
interface PermissionStatus {
|
|
178
|
+
/**
|
|
179
|
+
* One entry per whitelisted bucket, keyed by bucket name. This is the real
|
|
180
|
+
* answer; everything else on this object is a convenience over it.
|
|
181
|
+
*/
|
|
182
|
+
statuses: Partial<Record<DoorstepPermission, DoorstepPermissionStatus>>;
|
|
183
|
+
/**
|
|
184
|
+
* The legacy three-key view, kept so hosts written against the published 2.x
|
|
185
|
+
* API keep working. Collapsed from `statuses` as: `whenInUseOnly` and
|
|
186
|
+
* `unavailable` → `'granted'`, `notDetermined` → `'prompt'`, everything else
|
|
187
|
+
* (including `notDeclared`) → `'denied'`.
|
|
188
|
+
*
|
|
189
|
+
* `motion` is unconditionally `'granted'` on Android, as it has always been, and
|
|
190
|
+
* that is the honest answer to what the key asks: Android's IMU streams need no
|
|
191
|
+
* runtime grant, so motion collection is always possible. `activityRecognition`
|
|
192
|
+
* adds only the step-counter streams — read `statuses.activityRecognition` if you
|
|
193
|
+
* need its real state. On iOS `motion` does track Motion & Fitness, which really
|
|
194
|
+
* does gate capability there.
|
|
195
|
+
*
|
|
196
|
+
* @deprecated Read `statuses`.
|
|
197
|
+
*/
|
|
198
|
+
permissions: Record<DoorstepPermissionType, PermissionState>;
|
|
199
|
+
/**
|
|
200
|
+
* Whitelist entries this platform has no bucket for, echoed back rather than
|
|
201
|
+
* dropped in silence (e.g. `notifications` on iOS).
|
|
202
|
+
*/
|
|
203
|
+
unsupported: string[];
|
|
204
|
+
}
|
|
205
|
+
/** What {@link DoorstepAIModule.requestPermissions} answers. */
|
|
206
|
+
interface PermissionRequestResult extends PermissionStatus {
|
|
207
|
+
/** Buckets a dialog was actually raised for. */
|
|
208
|
+
requested: DoorstepPermission[];
|
|
209
|
+
/**
|
|
210
|
+
* Whitelisted buckets that were already answered, so the default policy left
|
|
211
|
+
* them alone.
|
|
212
|
+
*/
|
|
213
|
+
alreadyDetermined: DoorstepPermission[];
|
|
214
|
+
/**
|
|
215
|
+
* Whitelisted buckets that cannot be requested on this device or in this build
|
|
216
|
+
* (`unavailable` or `notDeclared`).
|
|
217
|
+
*/
|
|
218
|
+
unavailable: DoorstepPermission[];
|
|
219
|
+
/**
|
|
220
|
+
* Whitelisted buckets deliberately skipped, with the reason. The one to expect:
|
|
221
|
+
* `locationAlways` is only ever asked **alone and after foreground location is
|
|
222
|
+
* granted**, so a whitelist containing anything else askable defers it — call
|
|
223
|
+
* again once the first batch is answered.
|
|
224
|
+
*/
|
|
225
|
+
deferred: Partial<Record<DoorstepPermission, string>>;
|
|
226
|
+
/** True when at least one dialog was raised. */
|
|
227
|
+
didRequest: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Android only, diagnostic: the manifest permission strings actually passed to
|
|
230
|
+
* `ActivityCompat.requestPermissions`.
|
|
231
|
+
*/
|
|
232
|
+
androidPermissions?: string[];
|
|
233
|
+
}
|
|
234
|
+
/** Options for {@link DoorstepAIModule.requestPermissions}. */
|
|
235
|
+
interface PermissionRequestOptions {
|
|
236
|
+
/**
|
|
237
|
+
* The whitelist: **exactly these buckets are requested, and nothing else**.
|
|
238
|
+
* Omit it (or pass `undefined`) to request every bucket the platform has.
|
|
239
|
+
*
|
|
240
|
+
* An empty array requests nothing — it is not the same as omitting the field.
|
|
241
|
+
*/
|
|
242
|
+
permissions?: DoorstepPermissionInput[];
|
|
243
|
+
/**
|
|
244
|
+
* Skip buckets the user has already answered. Default `true`, which is what
|
|
245
|
+
* makes a launch-time call safe and what stops a deliberate "While Using the
|
|
246
|
+
* App" choice from being re-escalated. **iOS only** — on Android a first denial
|
|
247
|
+
* is re-askable by design, so the native planner always re-asks it.
|
|
248
|
+
*/
|
|
249
|
+
onlyIfNotDetermined?: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* How long to wait for each answer before giving up and reporting the state as
|
|
252
|
+
* it stands (default 120 s). A prompt the user never answers is reported
|
|
253
|
+
* `notDetermined`, not guessed at.
|
|
254
|
+
*/
|
|
255
|
+
timeoutSeconds?: number;
|
|
256
|
+
}
|
|
84
257
|
/**
|
|
85
258
|
* Mirrors the iOS SDK's `SDKLogLevel` enum. Only used by
|
|
86
259
|
* `configureRemoteLogging` (iOS only).
|
|
@@ -91,11 +264,180 @@ declare class DoorstepAIModule {
|
|
|
91
264
|
static init(notificationTitle?: string, notificationText?: string): Promise<void>;
|
|
92
265
|
static setApiKey(apiKey: string): void;
|
|
93
266
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
267
|
+
* Sets the API key for the Doorstep Go service, which is a separate credential
|
|
268
|
+
* from {@link setApiKey}. Present on both native SDKs; a no-op if you do not use
|
|
269
|
+
* Doorstep Go.
|
|
270
|
+
*/
|
|
271
|
+
static setDoorstepGoApiKey(apiKey: string): void;
|
|
272
|
+
/**
|
|
273
|
+
* The native SDK's internal-state dump as compact JSON, for bug reports and
|
|
274
|
+
* support logs. Free-form and unstable — never branch on it. **iOS only**
|
|
275
|
+
* (`DoorstepAI.debugStateJson()`); the Android SDK has no counterpart, so it
|
|
276
|
+
* rejects there.
|
|
277
|
+
*/
|
|
278
|
+
static debugStateJson(): Promise<string>;
|
|
279
|
+
/**
|
|
280
|
+
* Re-registers the raw-GNSS callbacks after the OS has dropped them (some
|
|
281
|
+
* devices stop delivering measurements without reporting an error). **Android
|
|
282
|
+
* only** — iOS has no raw-GNSS access at all, so it rejects there.
|
|
283
|
+
*/
|
|
284
|
+
static retryGnssCallbacks(): Promise<boolean>;
|
|
285
|
+
/**
|
|
286
|
+
* The dangerous runtime permissions the native SDK needs on THIS device,
|
|
287
|
+
* version-gated. **Android only.**
|
|
288
|
+
*
|
|
289
|
+
* Foreground set only — it deliberately excludes `ACCESS_BACKGROUND_LOCATION`,
|
|
290
|
+
* which Android 11+ requires be requested separately and only after foreground
|
|
291
|
+
* location is granted (see `requestBackgroundLocationPermission`).
|
|
292
|
+
*
|
|
293
|
+
* Feed it to your own permission UI (e.g. `PermissionsAndroid.requestMultiple`)
|
|
294
|
+
* when you want the grant results in JS — it is the same list `requestPermissions`
|
|
295
|
+
* asks for, so the two cannot diverge.
|
|
296
|
+
*
|
|
297
|
+
* @param includeBluetooth include `BLUETOOTH_SCAN` (Android 12+) and
|
|
298
|
+
* `NEARBY_WIFI_DEVICES` (Android 13+). Native default: `true`.
|
|
299
|
+
*/
|
|
300
|
+
static getRequiredPermissions(includeBluetooth?: boolean): Promise<string[]>;
|
|
301
|
+
/**
|
|
302
|
+
* True when every foreground permission the SDK needs is currently granted.
|
|
303
|
+
* **Android only.**
|
|
304
|
+
*
|
|
305
|
+
* @param includeBluetooth native default here is `false`, unlike the request
|
|
306
|
+
* methods — Bluetooth is optional, so a denied "Nearby devices" grant must not
|
|
307
|
+
* make the SDK look unusable.
|
|
308
|
+
*/
|
|
309
|
+
static hasRequiredPermissions(includeBluetooth?: boolean): Promise<boolean>;
|
|
310
|
+
/**
|
|
311
|
+
* True when `ACCESS_BACKGROUND_LOCATION` is granted (always true below API 29,
|
|
312
|
+
* where it is not a separate grant). **Android only.**
|
|
313
|
+
*/
|
|
314
|
+
static hasBackgroundLocationPermission(): Promise<boolean>;
|
|
315
|
+
/**
|
|
316
|
+
* The current state of the whitelisted permission buckets, on both platforms.
|
|
317
|
+
* **Pure observation — never prompts**, so it is safe at launch, on every
|
|
318
|
+
* screen, as often as you like.
|
|
319
|
+
*
|
|
320
|
+
* @param permissions whitelist; omit for every bucket this platform has.
|
|
321
|
+
*
|
|
322
|
+
* ```ts
|
|
323
|
+
* const { statuses } = await DoorstepAI.checkPermissions();
|
|
324
|
+
* if (statuses.locationAlways?.state === 'whenInUseOnly') {
|
|
325
|
+
* // foreground location only: background collection and route geofencing
|
|
326
|
+
* // will NOT work. Never read this as 'granted'.
|
|
327
|
+
* }
|
|
328
|
+
* ```
|
|
329
|
+
*
|
|
330
|
+
* The buckets and their states come straight from the native SDKs
|
|
331
|
+
* (`DoorstepAI.checkPermissions(...)` on both platforms) — the wrapper keeps no
|
|
332
|
+
* permission list and no state machine of its own.
|
|
333
|
+
*/
|
|
334
|
+
static checkPermissions(permissions?: DoorstepPermissionInput[]): Promise<PermissionStatus>;
|
|
335
|
+
/**
|
|
336
|
+
* Every permission bucket this platform has — the whitelist
|
|
337
|
+
* {@link requestPermissions} uses when you pass none.
|
|
338
|
+
*
|
|
339
|
+
* Useful for building a permission screen that lists what the SDK can ask for
|
|
340
|
+
* without hardcoding a per-platform list. Synchronous: it is the wrapper's name
|
|
341
|
+
* table, not a device read. Use {@link checkPermissions} for state.
|
|
342
|
+
*/
|
|
343
|
+
static allPermissionBuckets(): DoorstepPermission[];
|
|
344
|
+
/**
|
|
345
|
+
* {@link checkPermissions} rendered as the native SDK's own compact JSON — for
|
|
346
|
+
* bug reports, support logs and scripted on-device assertions.
|
|
347
|
+
*
|
|
348
|
+
* Shape: `{"<bucket>":{"state":"…","canRequest":true|false,"os":"…"}}`.
|
|
349
|
+
*/
|
|
350
|
+
static checkPermissionsJson(permissions?: DoorstepPermissionInput[]): Promise<string>;
|
|
351
|
+
/**
|
|
352
|
+
* The one permission requester, and the only one hosts should need.
|
|
353
|
+
*
|
|
354
|
+
* **No argument requests every bucket the platform has. An argument is a
|
|
355
|
+
* whitelist: exactly those buckets are requested and nothing else.** That is
|
|
356
|
+
* the native contract on both platforms
|
|
357
|
+
* (`DoorstepAI.requestPermissions(_ permissions:…)` on iOS,
|
|
358
|
+
* `DoorstepAI.requestPermissions(activity, permissions)` on Android) and this
|
|
359
|
+
* method is a pass-through to it — the wrapper does not decide what gets asked.
|
|
360
|
+
*
|
|
361
|
+
* ```ts
|
|
362
|
+
* await DoorstepAI.requestPermissions(); // everything
|
|
363
|
+
* await DoorstepAI.requestPermissions(['locationWhenInUse']); // just that
|
|
364
|
+
* await DoorstepAI.requestPermissions({ permissions: ['location', 'motion'] });
|
|
365
|
+
* ```
|
|
366
|
+
*
|
|
367
|
+
* Accepts the array directly or the legacy `{ permissions: [...] }` object; the
|
|
368
|
+
* object form additionally carries `onlyIfNotDetermined` (iOS) and
|
|
369
|
+
* `timeoutSeconds`.
|
|
370
|
+
*
|
|
371
|
+
* **Resolves only AFTER the user has answered**, with the settled state — a
|
|
372
|
+
* status read while a dialog is still up would be a lie. Anything the native
|
|
373
|
+
* planner declines to ask comes back explained rather than silent:
|
|
374
|
+
* `alreadyDetermined`, `unavailable`, `deferred`.
|
|
375
|
+
*
|
|
376
|
+
* The deferral to expect: **`locationAlways` is only ever requested alone, and
|
|
377
|
+
* only once foreground location is granted** (Android auto-denies a bundled
|
|
378
|
+
* background ask; iOS shows the When-In-Use prompt first and offers the Always
|
|
379
|
+
* upgrade later on its own schedule). So a full-whitelist call typically returns
|
|
380
|
+
* `locationAlways` in `deferred` — call again, with just that bucket, after the
|
|
381
|
+
* first batch is answered.
|
|
382
|
+
*
|
|
383
|
+
* A second call made while one is still in flight does not interleave prompt
|
|
384
|
+
* sequences: iOS reports every bucket as `deferred`, Android rejects with
|
|
385
|
+
* `E_PERMISSION_REQUEST_IN_FLIGHT`.
|
|
386
|
+
*
|
|
387
|
+
* iOS guidance from the SDK: call this **once, from a user-initiated flow**, not
|
|
388
|
+
* from app launch.
|
|
389
|
+
*/
|
|
390
|
+
static requestPermissions(options?: DoorstepPermissionInput[] | PermissionRequestOptions): Promise<PermissionRequestResult>;
|
|
391
|
+
/**
|
|
392
|
+
* Forward your Activity's `onRequestPermissionsResult` to the SDK. **Android
|
|
393
|
+
* only; a no-op elsewhere.**
|
|
394
|
+
*
|
|
395
|
+
* Optional but worth wiring: it is the only way the SDK can tell a refusal it
|
|
396
|
+
* may re-ask (`denied`) from one only Settings can fix (`permanentlyDenied`).
|
|
397
|
+
* Android reports the same signals for "permanently denied" and "never asked",
|
|
398
|
+
* and a *cancelled* dialog leaves the same trace as a denial — so the SDK
|
|
399
|
+
* refuses to guess and reports the re-askable `denied` until a real,
|
|
400
|
+
* host-forwarded answer says otherwise.
|
|
401
|
+
*
|
|
402
|
+
* It also settles a `requestPermissions` promise the moment the real answer
|
|
403
|
+
* arrives, instead of waiting on the activity-lifecycle backstop.
|
|
404
|
+
*
|
|
405
|
+
* ```kotlin
|
|
406
|
+
* // MainActivity.kt
|
|
407
|
+
* override fun onRequestPermissionsResult(
|
|
408
|
+
* requestCode: Int, permissions: Array<out String>, grantResults: IntArray
|
|
409
|
+
* ) {
|
|
410
|
+
* super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
|
411
|
+
* DoorstepAI.notePermissionRequestResult(this, permissions, grantResults)
|
|
412
|
+
* }
|
|
413
|
+
* ```
|
|
414
|
+
*
|
|
415
|
+
* If you would rather not touch Kotlin, call this from JS with the same values.
|
|
416
|
+
*/
|
|
417
|
+
static notePermissionRequestResult(permissions: string[], grantResults: number[]): Promise<void>;
|
|
418
|
+
/**
|
|
419
|
+
* Requests `ACCESS_BACKGROUND_LOCATION` (Android 10+), required to keep
|
|
420
|
+
* collecting once the host app is backgrounded or the screen is off — without it
|
|
421
|
+
* the SDK refuses to start a session from the background and route geofences
|
|
422
|
+
* only fire in the foreground. **Android only.**
|
|
423
|
+
*
|
|
424
|
+
* This is a separate entry point because Android makes it one: from Android 11+
|
|
425
|
+
* the OS refuses to bundle background location into the foreground request, so it
|
|
426
|
+
* has to be a SECOND prompt issued after foreground location is granted, and
|
|
427
|
+
* asking earlier burns it on an automatic denial. The wrapper does not sequence
|
|
428
|
+
* the two calls for you — deciding when the user has been told why the app wants
|
|
429
|
+
* "Allow all the time" is the host's, not the wrapper's.
|
|
430
|
+
*
|
|
431
|
+
* On iOS the same intent is the `locationAlways` bucket of
|
|
432
|
+
* `requestPermissions`; there is no iOS counterpart to this method, so it
|
|
433
|
+
* rejects there rather than resolving a made-up answer. On Android you can also
|
|
434
|
+
* express it as `requestPermissions(['locationAlways'])` — same prompt, and it
|
|
435
|
+
* reports back why if the OS would have refused to show it.
|
|
436
|
+
*
|
|
437
|
+
* Resolves `true` when a request was actually issued (false below API 29 or when
|
|
438
|
+
* already granted).
|
|
97
439
|
*/
|
|
98
|
-
static
|
|
440
|
+
static requestBackgroundLocationPermission(): Promise<boolean>;
|
|
99
441
|
/**
|
|
100
442
|
* Configures the iOS SDK's remote logging pipeline. No-op on Android (the
|
|
101
443
|
* Android SDK currently configures remote logging via remote config / dev
|
|
@@ -158,5 +500,5 @@ declare class DoorstepAIModule {
|
|
|
158
500
|
static disableDevMode(): Promise<boolean>;
|
|
159
501
|
}
|
|
160
502
|
export { DoorstepAIModule as DoorstepAI };
|
|
161
|
-
export type { AddressType, LatLngObject, StartDeliveryOptions, SDKLogLevel, DeliveryStop, RouteGeofenceOptions, GeofenceSessionEvent, GeofenceSessionEventType, };
|
|
503
|
+
export type { AddressType, LatLngObject, StartDeliveryOptions, DoorstepPermission, DoorstepPermissionAlias, DoorstepPermissionInput, DoorstepPermissionState, DoorstepPermissionStatus, PermissionState, DoorstepPermissionType, PermissionStatus, PermissionRequestOptions, PermissionRequestResult, SDKLogLevel, DeliveryStop, RouteGeofenceOptions, GeofenceSessionEvent, GeofenceSessionEventType, };
|
|
162
504
|
//# sourceMappingURL=DoorstepAI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DoorstepAI.d.ts","sourceRoot":"","sources":["../../../src/DoorstepAI.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAUxD,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB,EAAE,MAAM,CA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,iBAAiB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAUzD;;;;OAIG;IACH,MAAM,CAAC,0BAA0B,CAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,GAC9C,mBAAmB,GAAG,SAAS;WAMrB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ5D,0CAA0C;WAC7B,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC;IAKtD,kCAAkC;WACrB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAIhD;AAED,OAAO,EAAE,gBAAgB,IAAI,UAAU,EAAE,CAAC;AAC1C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,GACzB,CAAC"}
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
+
import type { DoorstepPermissionInput } from './DoorstepAI';
|
|
2
|
+
/**
|
|
3
|
+
* Drop-in bootstrap: mount it once, near the root, and it runs the SDK's
|
|
4
|
+
* `init` + `setApiKey` and the permission sequence for you. Everything it does is
|
|
5
|
+
* available a la carte on {@link DoorstepAI} — this component exists so a host
|
|
6
|
+
* that just wants the default flow does not have to write it.
|
|
7
|
+
*/
|
|
1
8
|
export declare function RootDoorstepAI(props: {
|
|
2
9
|
apiKey: string;
|
|
3
10
|
notificationTitle?: string;
|
|
4
11
|
notificationText?: string;
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
12
|
+
/**
|
|
13
|
+
* The whitelist handed to `requestPermissions`: **exactly these buckets are
|
|
14
|
+
* requested and nothing else.** Omit it to request every bucket the platform
|
|
15
|
+
* has, which is the SDK's own default.
|
|
16
|
+
*/
|
|
17
|
+
permissions?: DoorstepPermissionInput[];
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Pass a {@link permissions} whitelist instead — it can narrow any
|
|
20
|
+
* bucket, not just this one. Kept because it was the published prop: `false`
|
|
21
|
+
* drops the platform's Bluetooth bucket from the default whitelist. Ignored when
|
|
22
|
+
* `permissions` is given.
|
|
23
|
+
*/
|
|
7
24
|
requestBluetooth?: boolean;
|
|
8
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Run the second-phase background-location request (`locationAlways`) once
|
|
27
|
+
* foreground location has been granted. Default on.
|
|
28
|
+
*
|
|
29
|
+
* It has to be a second phase because Android forbids bundling background
|
|
30
|
+
* location with the foreground ask — a bundled request is auto-denied from
|
|
31
|
+
* Android 11 on. Turn it off if your app asks for "Allow all the time" from its
|
|
32
|
+
* own onboarding UI; without the grant the SDK cannot collect while
|
|
33
|
+
* backgrounded and route geofences fire foreground-only.
|
|
34
|
+
*/
|
|
35
|
+
requestBackgroundLocation?: boolean;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
9
37
|
//# sourceMappingURL=RootDoorstepAI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RootDoorstepAI.d.ts","sourceRoot":"","sources":["../../../src/RootDoorstepAI.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RootDoorstepAI.d.ts","sourceRoot":"","sources":["../../../src/RootDoorstepAI.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAI5D;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACxC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;;;OASG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,+BAyHA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootDoorstepAI } from './RootDoorstepAI';
|
|
2
2
|
import { DoorstepAI } from './DoorstepAI';
|
|
3
|
-
export type { AddressType, LatLngObject, StartDeliveryOptions, SDKLogLevel, DeliveryStop, RouteGeofenceOptions, GeofenceSessionEvent, GeofenceSessionEventType, } from './DoorstepAI';
|
|
3
|
+
export type { AddressType, LatLngObject, StartDeliveryOptions, DoorstepPermission, DoorstepPermissionAlias, DoorstepPermissionInput, DoorstepPermissionState, DoorstepPermissionStatus, PermissionState, DoorstepPermissionType, PermissionStatus, PermissionRequestOptions, PermissionRequestResult, SDKLogLevel, DeliveryStop, RouteGeofenceOptions, GeofenceSessionEvent, GeofenceSessionEventType, } from './DoorstepAI';
|
|
4
4
|
export { DoorstepAI, RootDoorstepAI };
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|