@doorstepai/dropoff-sdk 2.0.6 → 2.0.8
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/android/build.gradle +1 -1
- package/android/src/main/java/com/doorstepai/dropoffsdk/DoorstepAIModule.kt +21 -5
- package/ios/DoorstepAI.mm +24 -14
- package/ios/DoorstepAI.swift +51 -28
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Info.plist +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.abi.json +312 -155
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +7 -7
- 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 +7 -7
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/_CodeSignature/CodeResources +11 -11
- 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 +2116 -2105
- 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/Info.plist +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +312 -155
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +7 -7
- 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 +7 -7
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +312 -155
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +7 -7
- 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 +7 -7
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/_CodeSignature/CodeResources +21 -21
- 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 +2116 -2105
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/DoorstepDropoffSDK.yml +2105 -2095
- package/lib/module/DoorstepAI.js +22 -10
- package/lib/module/DoorstepAI.js.map +1 -1
- package/lib/typescript/src/DoorstepAI.d.ts +10 -0
- package/lib/typescript/src/DoorstepAI.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/DoorstepAI.tsx +57 -15
package/android/build.gradle
CHANGED
|
@@ -86,7 +86,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
|
86
86
|
dependencies {
|
|
87
87
|
implementation "com.facebook.react:react-android"
|
|
88
88
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
89
|
-
implementation("ai.doorstep.com:doorstepai-dropoff-sdk:2.0.
|
|
89
|
+
implementation("ai.doorstep.com:doorstepai-dropoff-sdk:2.0.10")
|
|
90
90
|
api "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1"
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -45,6 +45,8 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
45
45
|
timeoutSeconds: Double?,
|
|
46
46
|
autoStopAfterDropoffSeconds: Double?,
|
|
47
47
|
manualForeground: Boolean?,
|
|
48
|
+
customerId: String?,
|
|
49
|
+
driverId: String?,
|
|
48
50
|
promise: Promise
|
|
49
51
|
) {
|
|
50
52
|
try {
|
|
@@ -53,7 +55,9 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
53
55
|
deliveryId = deliveryId,
|
|
54
56
|
timeoutSeconds = timeoutSeconds,
|
|
55
57
|
manualForeground = manualForeground ?: false,
|
|
56
|
-
autoStopAfterDropoffSeconds = autoStopAfterDropoffSeconds
|
|
58
|
+
autoStopAfterDropoffSeconds = autoStopAfterDropoffSeconds,
|
|
59
|
+
customerId = customerId,
|
|
60
|
+
driverId = driverId
|
|
57
61
|
) { result ->
|
|
58
62
|
result.onSuccess { sessionId ->
|
|
59
63
|
promise.resolve(sessionId)
|
|
@@ -71,10 +75,12 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
71
75
|
plusCode: String,
|
|
72
76
|
deliveryId: String,
|
|
73
77
|
timeoutSeconds: Double?,
|
|
78
|
+
customerId: String?,
|
|
79
|
+
driverId: String?,
|
|
74
80
|
promise: Promise
|
|
75
81
|
) {
|
|
76
82
|
try {
|
|
77
|
-
DoorstepAI.startDeliveryByPlusCode(plusCode, deliveryId, timeoutSeconds) { result ->
|
|
83
|
+
DoorstepAI.startDeliveryByPlusCode(plusCode, deliveryId, timeoutSeconds, customerId, driverId) { result ->
|
|
78
84
|
result.onSuccess { sessionId ->
|
|
79
85
|
promise.resolve(sessionId)
|
|
80
86
|
}.onFailure { error ->
|
|
@@ -94,6 +100,8 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
94
100
|
timeoutSeconds: Double?,
|
|
95
101
|
autoStopAfterDropoffSeconds: Double?,
|
|
96
102
|
manualForeground: Boolean?,
|
|
103
|
+
customerId: String?,
|
|
104
|
+
driverId: String?,
|
|
97
105
|
promise: Promise
|
|
98
106
|
) {
|
|
99
107
|
try {
|
|
@@ -104,7 +112,9 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
104
112
|
coordinates = coords,
|
|
105
113
|
timeoutSeconds = timeoutSeconds,
|
|
106
114
|
manualForeground = manualForeground ?: false,
|
|
107
|
-
autoStopAfterDropoffSeconds = autoStopAfterDropoffSeconds
|
|
115
|
+
autoStopAfterDropoffSeconds = autoStopAfterDropoffSeconds,
|
|
116
|
+
customerId = customerId,
|
|
117
|
+
driverId = driverId
|
|
108
118
|
) { result ->
|
|
109
119
|
result.onSuccess { message ->
|
|
110
120
|
promise.resolve(message)
|
|
@@ -124,10 +134,12 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
124
134
|
subUnit: String,
|
|
125
135
|
deliveryId: String,
|
|
126
136
|
timeoutSeconds: Double?,
|
|
137
|
+
customerId: String?,
|
|
138
|
+
driverId: String?,
|
|
127
139
|
promise: Promise
|
|
128
140
|
) {
|
|
129
141
|
try {
|
|
130
|
-
DoorstepAI.startDeliveryByLatLng(latitude, longitude, subUnit, deliveryId, timeoutSeconds) { result ->
|
|
142
|
+
DoorstepAI.startDeliveryByLatLng(latitude, longitude, subUnit, deliveryId, timeoutSeconds, customerId, driverId) { result ->
|
|
131
143
|
result.onSuccess { message ->
|
|
132
144
|
promise.resolve(message)
|
|
133
145
|
}.onFailure { error ->
|
|
@@ -147,6 +159,8 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
147
159
|
timeoutSeconds: Double?,
|
|
148
160
|
autoStopAfterDropoffSeconds: Double?,
|
|
149
161
|
manualForeground: Boolean?,
|
|
162
|
+
customerId: String?,
|
|
163
|
+
driverId: String?,
|
|
150
164
|
promise: Promise
|
|
151
165
|
) {
|
|
152
166
|
try {
|
|
@@ -173,7 +187,9 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
173
187
|
coordinates = coords,
|
|
174
188
|
timeoutSeconds = timeoutSeconds,
|
|
175
189
|
manualForeground = manualForeground ?: false,
|
|
176
|
-
autoStopAfterDropoffSeconds = autoStopAfterDropoffSeconds
|
|
190
|
+
autoStopAfterDropoffSeconds = autoStopAfterDropoffSeconds,
|
|
191
|
+
customerId = customerId,
|
|
192
|
+
driverId = driverId
|
|
177
193
|
) { result ->
|
|
178
194
|
result.onSuccess { sessionId ->
|
|
179
195
|
promise.resolve(sessionId)
|
package/ios/DoorstepAI.mm
CHANGED
|
@@ -5,45 +5,55 @@
|
|
|
5
5
|
RCT_EXTERN_METHOD(setApiKey:(nonnull NSString *)apiKey)
|
|
6
6
|
RCT_EXTERN_METHOD(requestAllPermissions:(BOOL)requestAlwaysLocation)
|
|
7
7
|
RCT_EXTERN_METHOD(configureRemoteLogging:(BOOL)enabled
|
|
8
|
-
minLevel:(
|
|
9
|
-
flushIntervalSeconds:(
|
|
10
|
-
batchSize:(
|
|
11
|
-
maxQueueSize:(
|
|
8
|
+
minLevel:(id)minLevel
|
|
9
|
+
flushIntervalSeconds:(id)flushIntervalSeconds
|
|
10
|
+
batchSize:(id)batchSize
|
|
11
|
+
maxQueueSize:(id)maxQueueSize)
|
|
12
12
|
RCT_EXTERN_METHOD(enableDevMode:(nonnull NSString *)apiKey
|
|
13
13
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
14
14
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
15
15
|
RCT_EXTERN_METHOD(startDeliveryByPlaceID:(nonnull NSString *)placeID
|
|
16
16
|
deliveryId:(nonnull NSString *)deliveryId
|
|
17
|
-
timeoutSeconds:(
|
|
18
|
-
autoStopAfterDropoffSeconds:(
|
|
17
|
+
timeoutSeconds:(id)timeoutSeconds
|
|
18
|
+
autoStopAfterDropoffSeconds:(id)autoStopAfterDropoffSeconds
|
|
19
|
+
customerId:(nullable NSString *)customerId
|
|
20
|
+
driverId:(nullable NSString *)driverId
|
|
19
21
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
20
22
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
21
23
|
RCT_EXTERN_METHOD(startDeliveryByPlusCode:(nonnull NSString *)plusCode
|
|
22
24
|
deliveryId:(nonnull NSString *)deliveryId
|
|
23
|
-
timeoutSeconds:(
|
|
24
|
-
autoStopAfterDropoffSeconds:(
|
|
25
|
+
timeoutSeconds:(id)timeoutSeconds
|
|
26
|
+
autoStopAfterDropoffSeconds:(id)autoStopAfterDropoffSeconds
|
|
27
|
+
customerId:(nullable NSString *)customerId
|
|
28
|
+
driverId:(nullable NSString *)driverId
|
|
25
29
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
26
30
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
27
31
|
RCT_EXTERN_METHOD(startDeliveryByAddress:(nonnull NSDictionary *)address
|
|
28
32
|
deliveryId:(nonnull NSString *)deliveryId
|
|
29
33
|
coordinates:(nullable NSDictionary *)coordinates
|
|
30
|
-
timeoutSeconds:(
|
|
31
|
-
autoStopAfterDropoffSeconds:(
|
|
34
|
+
timeoutSeconds:(id)timeoutSeconds
|
|
35
|
+
autoStopAfterDropoffSeconds:(id)autoStopAfterDropoffSeconds
|
|
36
|
+
customerId:(nullable NSString *)customerId
|
|
37
|
+
driverId:(nullable NSString *)driverId
|
|
32
38
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
33
39
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
34
40
|
RCT_EXTERN_METHOD(startDeliveryByAddressString:(nonnull NSString *)address
|
|
35
41
|
deliveryId:(nonnull NSString *)deliveryId
|
|
36
42
|
coordinates:(nullable NSDictionary *)coordinates
|
|
37
|
-
timeoutSeconds:(
|
|
38
|
-
autoStopAfterDropoffSeconds:(
|
|
43
|
+
timeoutSeconds:(id)timeoutSeconds
|
|
44
|
+
autoStopAfterDropoffSeconds:(id)autoStopAfterDropoffSeconds
|
|
45
|
+
customerId:(nullable NSString *)customerId
|
|
46
|
+
driverId:(nullable NSString *)driverId
|
|
39
47
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
40
48
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
41
49
|
RCT_EXTERN_METHOD(startDeliveryByLatLng:(nonnull NSNumber *)latitude
|
|
42
50
|
longitude:(nonnull NSNumber *)longitude
|
|
43
51
|
subUnit:(nonnull NSString *)subUnit
|
|
44
52
|
deliveryId:(nonnull NSString *)deliveryId
|
|
45
|
-
timeoutSeconds:(
|
|
46
|
-
autoStopAfterDropoffSeconds:(
|
|
53
|
+
timeoutSeconds:(id)timeoutSeconds
|
|
54
|
+
autoStopAfterDropoffSeconds:(id)autoStopAfterDropoffSeconds
|
|
55
|
+
customerId:(nullable NSString *)customerId
|
|
56
|
+
driverId:(nullable NSString *)driverId
|
|
47
57
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
48
58
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
49
59
|
RCT_EXTERN_METHOD(newEvent:(nonnull NSString *)eventName
|
package/ios/DoorstepAI.swift
CHANGED
|
@@ -31,35 +31,42 @@ class DoorstepAIBridge: NSObject {
|
|
|
31
31
|
|
|
32
32
|
@objc
|
|
33
33
|
func configureRemoteLogging(_ enabled: Bool,
|
|
34
|
-
minLevel:
|
|
35
|
-
flushIntervalSeconds:
|
|
36
|
-
batchSize:
|
|
37
|
-
maxQueueSize:
|
|
38
|
-
|
|
34
|
+
minLevel: Any?,
|
|
35
|
+
flushIntervalSeconds: Any?,
|
|
36
|
+
batchSize: Any?,
|
|
37
|
+
maxQueueSize: Any?) {
|
|
38
|
+
// React Native's bridge forces all `NSNumber *` params to be non-nullable
|
|
39
|
+
// (see RCTModuleMethod.mm — it rejects NSNull for NSNumber). We accept `Any?`
|
|
40
|
+
// here so JS can pass `null` for optional numeric args without bridge errors.
|
|
41
|
+
let level = (minLevel as? NSNumber).flatMap { SDKLogLevel(rawValue: $0.intValue) } ?? .warning
|
|
39
42
|
DoorstepAI.configureRemoteLogging(
|
|
40
43
|
enabled: enabled,
|
|
41
44
|
minLevel: level,
|
|
42
|
-
flushInterval: flushIntervalSeconds?.doubleValue ?? 30,
|
|
43
|
-
batchSize: batchSize?.intValue ?? 50,
|
|
44
|
-
maxQueueSize: maxQueueSize?.intValue ?? 1000
|
|
45
|
+
flushInterval: (flushIntervalSeconds as? NSNumber)?.doubleValue ?? 30,
|
|
46
|
+
batchSize: (batchSize as? NSNumber)?.intValue ?? 50,
|
|
47
|
+
maxQueueSize: (maxQueueSize as? NSNumber)?.intValue ?? 1000
|
|
45
48
|
)
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
@objc
|
|
49
52
|
func startDeliveryByPlaceID(_ placeID: NSString,
|
|
50
53
|
deliveryId: NSString,
|
|
51
|
-
timeoutSeconds:
|
|
52
|
-
autoStopAfterDropoffSeconds:
|
|
54
|
+
timeoutSeconds: Any?,
|
|
55
|
+
autoStopAfterDropoffSeconds: Any?,
|
|
56
|
+
customerId: NSString?,
|
|
57
|
+
driverId: NSString?,
|
|
53
58
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
54
59
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
55
60
|
// Use Swift's concurrency support to call the async method.
|
|
56
61
|
Task {
|
|
57
62
|
do {
|
|
58
|
-
let timeout = timeoutSeconds?.doubleValue
|
|
59
|
-
let autoStop = autoStopAfterDropoffSeconds?.doubleValue
|
|
63
|
+
let timeout = (timeoutSeconds as? NSNumber)?.doubleValue
|
|
64
|
+
let autoStop = (autoStopAfterDropoffSeconds as? NSNumber)?.doubleValue
|
|
60
65
|
try await DoorstepAI.startDeliveryByPlaceID(
|
|
61
66
|
placeID: placeID as String,
|
|
62
67
|
deliveryId: deliveryId as String,
|
|
68
|
+
customerId: customerId as String?,
|
|
69
|
+
driverId: driverId as String?,
|
|
63
70
|
timeoutSeconds: timeout,
|
|
64
71
|
autoStopAfterDropoffSeconds: autoStop
|
|
65
72
|
)
|
|
@@ -73,17 +80,21 @@ class DoorstepAIBridge: NSObject {
|
|
|
73
80
|
@objc
|
|
74
81
|
func startDeliveryByPlusCode(_ plusCode: NSString,
|
|
75
82
|
deliveryId: NSString,
|
|
76
|
-
timeoutSeconds:
|
|
77
|
-
autoStopAfterDropoffSeconds:
|
|
83
|
+
timeoutSeconds: Any?,
|
|
84
|
+
autoStopAfterDropoffSeconds: Any?,
|
|
85
|
+
customerId: NSString?,
|
|
86
|
+
driverId: NSString?,
|
|
78
87
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
79
88
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
80
89
|
Task {
|
|
81
90
|
do {
|
|
82
|
-
let timeout = timeoutSeconds?.doubleValue
|
|
83
|
-
let autoStop = autoStopAfterDropoffSeconds?.doubleValue
|
|
91
|
+
let timeout = (timeoutSeconds as? NSNumber)?.doubleValue
|
|
92
|
+
let autoStop = (autoStopAfterDropoffSeconds as? NSNumber)?.doubleValue
|
|
84
93
|
try await DoorstepAI.startDeliveryByPlusCode(
|
|
85
94
|
plusCode: plusCode as String,
|
|
86
95
|
deliveryId: deliveryId as String,
|
|
96
|
+
customerId: customerId as String?,
|
|
97
|
+
driverId: driverId as String?,
|
|
87
98
|
timeoutSeconds: timeout,
|
|
88
99
|
autoStopAfterDropoffSeconds: autoStop
|
|
89
100
|
)
|
|
@@ -98,18 +109,22 @@ class DoorstepAIBridge: NSObject {
|
|
|
98
109
|
func startDeliveryByAddressString(_ address: NSString,
|
|
99
110
|
deliveryId: NSString,
|
|
100
111
|
coordinates: NSDictionary?,
|
|
101
|
-
timeoutSeconds:
|
|
102
|
-
autoStopAfterDropoffSeconds:
|
|
112
|
+
timeoutSeconds: Any?,
|
|
113
|
+
autoStopAfterDropoffSeconds: Any?,
|
|
114
|
+
customerId: NSString?,
|
|
115
|
+
driverId: NSString?,
|
|
103
116
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
104
117
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
105
118
|
Task {
|
|
106
119
|
do {
|
|
107
|
-
let timeout = timeoutSeconds?.doubleValue
|
|
108
|
-
let autoStop = autoStopAfterDropoffSeconds?.doubleValue
|
|
120
|
+
let timeout = (timeoutSeconds as? NSNumber)?.doubleValue
|
|
121
|
+
let autoStop = (autoStopAfterDropoffSeconds as? NSNumber)?.doubleValue
|
|
109
122
|
let coords = parseCoordinates(coordinates)
|
|
110
123
|
try await DoorstepAI.startDeliveryByAddressString(
|
|
111
124
|
address: address as String,
|
|
112
125
|
deliveryId: deliveryId as String,
|
|
126
|
+
customerId: customerId as String?,
|
|
127
|
+
driverId: driverId as String?,
|
|
113
128
|
coordinates: coords,
|
|
114
129
|
timeoutSeconds: timeout,
|
|
115
130
|
autoStopAfterDropoffSeconds: autoStop
|
|
@@ -126,19 +141,23 @@ class DoorstepAIBridge: NSObject {
|
|
|
126
141
|
longitude: NSNumber,
|
|
127
142
|
subUnit: NSString,
|
|
128
143
|
deliveryId: NSString,
|
|
129
|
-
timeoutSeconds:
|
|
130
|
-
autoStopAfterDropoffSeconds:
|
|
144
|
+
timeoutSeconds: Any?,
|
|
145
|
+
autoStopAfterDropoffSeconds: Any?,
|
|
146
|
+
customerId: NSString?,
|
|
147
|
+
driverId: NSString?,
|
|
131
148
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
132
149
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
133
150
|
Task {
|
|
134
151
|
do {
|
|
135
|
-
let timeout = timeoutSeconds?.doubleValue
|
|
136
|
-
let autoStop = autoStopAfterDropoffSeconds?.doubleValue
|
|
152
|
+
let timeout = (timeoutSeconds as? NSNumber)?.doubleValue
|
|
153
|
+
let autoStop = (autoStopAfterDropoffSeconds as? NSNumber)?.doubleValue
|
|
137
154
|
try await DoorstepAI.startDeliveryByLatLng(
|
|
138
155
|
latitude: latitude.doubleValue,
|
|
139
156
|
longitude: longitude.doubleValue,
|
|
140
157
|
subUnit: subUnit as String,
|
|
141
158
|
deliveryId: deliveryId as String,
|
|
159
|
+
customerId: customerId as String?,
|
|
160
|
+
driverId: driverId as String?,
|
|
142
161
|
timeoutSeconds: timeout,
|
|
143
162
|
autoStopAfterDropoffSeconds: autoStop
|
|
144
163
|
)
|
|
@@ -153,8 +172,10 @@ class DoorstepAIBridge: NSObject {
|
|
|
153
172
|
func startDeliveryByAddress(_ address: [String: Any],
|
|
154
173
|
deliveryId: NSString,
|
|
155
174
|
coordinates: NSDictionary?,
|
|
156
|
-
timeoutSeconds:
|
|
157
|
-
autoStopAfterDropoffSeconds:
|
|
175
|
+
timeoutSeconds: Any?,
|
|
176
|
+
autoStopAfterDropoffSeconds: Any?,
|
|
177
|
+
customerId: NSString?,
|
|
178
|
+
driverId: NSString?,
|
|
158
179
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
159
180
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
160
181
|
Task {
|
|
@@ -176,12 +197,14 @@ class DoorstepAIBridge: NSObject {
|
|
|
176
197
|
administrativeAreaLevel1: administrativeAreaLevel1,
|
|
177
198
|
postalCode: postalCode)
|
|
178
199
|
|
|
179
|
-
let timeout = timeoutSeconds?.doubleValue
|
|
180
|
-
let autoStop = autoStopAfterDropoffSeconds?.doubleValue
|
|
200
|
+
let timeout = (timeoutSeconds as? NSNumber)?.doubleValue
|
|
201
|
+
let autoStop = (autoStopAfterDropoffSeconds as? NSNumber)?.doubleValue
|
|
181
202
|
let coords = parseCoordinates(coordinates)
|
|
182
203
|
try await DoorstepAI.startDeliveryByAddressType(
|
|
183
204
|
address: addressStruct,
|
|
184
205
|
deliveryId: deliveryId as String,
|
|
206
|
+
customerId: customerId as String?,
|
|
207
|
+
driverId: driverId as String?,
|
|
185
208
|
coordinates: coords,
|
|
186
209
|
timeoutSeconds: timeout,
|
|
187
210
|
autoStopAfterDropoffSeconds: autoStop
|