@doorstepai/dropoff-sdk 1.0.32 → 2.0.1
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 +53 -9
- package/ios/DoorstepAI.mm +24 -14
- package/ios/DoorstepAI.swift +64 -5
- 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/Info.plist +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.abi.json +1487 -138
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +54 -10
- 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 +54 -10
- 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 +1451 -816
- 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 +1487 -138
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +54 -10
- 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 +54 -10
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +1487 -138
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +54 -10
- 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 +54 -10
- 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 +1451 -816
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/DoorstepDropoffSDK.yml +1446 -815
- package/lib/module/DoorstepAI.js +32 -54
- package/lib/module/DoorstepAI.js.map +1 -1
- package/lib/typescript/src/DoorstepAI.d.ts +6 -5
- package/lib/typescript/src/DoorstepAI.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/DoorstepAI.tsx +70 -53
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:
|
|
89
|
+
implementation("ai.doorstep.com:doorstepai-dropoff-sdk:2.0.0")
|
|
90
90
|
api "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1"
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactMethod
|
|
|
8
8
|
import com.facebook.react.bridge.Promise
|
|
9
9
|
import com.doorstepai.sdks.tracking.DoorstepAI
|
|
10
10
|
import com.doorstepai.sdks.tracking.AddressType
|
|
11
|
+
import com.doorstepai.sdks.tracking.DropoffType
|
|
11
12
|
import com.facebook.react.bridge.ReadableMap
|
|
12
13
|
import kotlinx.coroutines.Dispatchers
|
|
13
14
|
import kotlinx.coroutines.CoroutineScope
|
|
@@ -37,9 +38,14 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
@ReactMethod
|
|
40
|
-
fun startDeliveryByPlaceID(
|
|
41
|
+
fun startDeliveryByPlaceID(
|
|
42
|
+
placeID: String,
|
|
43
|
+
deliveryId: String,
|
|
44
|
+
timeoutSeconds: Double?,
|
|
45
|
+
promise: Promise
|
|
46
|
+
) {
|
|
41
47
|
try {
|
|
42
|
-
DoorstepAI.startDeliveryByPlaceID(placeID, deliveryId) { result ->
|
|
48
|
+
DoorstepAI.startDeliveryByPlaceID(placeID, deliveryId, timeoutSeconds) { result ->
|
|
43
49
|
result.onSuccess { sessionId ->
|
|
44
50
|
promise.resolve(sessionId)
|
|
45
51
|
}.onFailure { error ->
|
|
@@ -52,9 +58,14 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
@ReactMethod
|
|
55
|
-
fun startDeliveryByPlusCode(
|
|
61
|
+
fun startDeliveryByPlusCode(
|
|
62
|
+
plusCode: String,
|
|
63
|
+
deliveryId: String,
|
|
64
|
+
timeoutSeconds: Double?,
|
|
65
|
+
promise: Promise
|
|
66
|
+
) {
|
|
56
67
|
try {
|
|
57
|
-
DoorstepAI.startDeliveryByPlusCode(plusCode, deliveryId) { result ->
|
|
68
|
+
DoorstepAI.startDeliveryByPlusCode(plusCode, deliveryId, timeoutSeconds) { result ->
|
|
58
69
|
result.onSuccess { sessionId ->
|
|
59
70
|
promise.resolve(sessionId)
|
|
60
71
|
}.onFailure { error ->
|
|
@@ -67,9 +78,14 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
67
78
|
}
|
|
68
79
|
|
|
69
80
|
@ReactMethod
|
|
70
|
-
fun startDeliveryByAddressString(
|
|
81
|
+
fun startDeliveryByAddressString(
|
|
82
|
+
address: String,
|
|
83
|
+
deliveryId: String,
|
|
84
|
+
timeoutSeconds: Double?,
|
|
85
|
+
promise: Promise
|
|
86
|
+
) {
|
|
71
87
|
try {
|
|
72
|
-
DoorstepAI.startDeliveryByAddressString(address, deliveryId) { result ->
|
|
88
|
+
DoorstepAI.startDeliveryByAddressString(address, deliveryId, timeoutSeconds) { result ->
|
|
73
89
|
result.onSuccess { message ->
|
|
74
90
|
promise.resolve(message)
|
|
75
91
|
}.onFailure { error ->
|
|
@@ -82,9 +98,16 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
82
98
|
}
|
|
83
99
|
|
|
84
100
|
@ReactMethod
|
|
85
|
-
fun startDeliveryByLatLng(
|
|
101
|
+
fun startDeliveryByLatLng(
|
|
102
|
+
latitude: Double,
|
|
103
|
+
longitude: Double,
|
|
104
|
+
subUnit: String,
|
|
105
|
+
deliveryId: String,
|
|
106
|
+
timeoutSeconds: Double?,
|
|
107
|
+
promise: Promise
|
|
108
|
+
) {
|
|
86
109
|
try {
|
|
87
|
-
DoorstepAI.startDeliveryByLatLng(latitude, longitude, deliveryId) { result ->
|
|
110
|
+
DoorstepAI.startDeliveryByLatLng(latitude, longitude, subUnit, deliveryId, timeoutSeconds) { result ->
|
|
88
111
|
result.onSuccess { message ->
|
|
89
112
|
promise.resolve(message)
|
|
90
113
|
}.onFailure { error ->
|
|
@@ -100,6 +123,7 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
100
123
|
fun startDeliveryByAddress(
|
|
101
124
|
addressMap: ReadableMap,
|
|
102
125
|
deliveryId: String,
|
|
126
|
+
timeoutSeconds: Double?,
|
|
103
127
|
promise: Promise
|
|
104
128
|
) {
|
|
105
129
|
try {
|
|
@@ -119,7 +143,7 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
119
143
|
postalCode = postalCode
|
|
120
144
|
)
|
|
121
145
|
|
|
122
|
-
DoorstepAI.startDeliveryByAddressType(address, deliveryId) { result ->
|
|
146
|
+
DoorstepAI.startDeliveryByAddressType(address, deliveryId, timeoutSeconds) { result ->
|
|
123
147
|
result.onSuccess { sessionId ->
|
|
124
148
|
promise.resolve(sessionId)
|
|
125
149
|
}.onFailure { error ->
|
|
@@ -141,6 +165,26 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
|
|
|
141
165
|
}
|
|
142
166
|
}
|
|
143
167
|
|
|
168
|
+
@ReactMethod
|
|
169
|
+
fun markDropoff(deliveryId: String, dropoffType: String, promise: Promise) {
|
|
170
|
+
CoroutineScope(Dispatchers.IO).launch {
|
|
171
|
+
try {
|
|
172
|
+
val type = when (dropoffType.uppercase()) {
|
|
173
|
+
"POD" -> DropoffType.POD
|
|
174
|
+
"NON_POD" -> DropoffType.NON_POD
|
|
175
|
+
else -> {
|
|
176
|
+
promise.reject("DROP_OFF_TYPE_ERROR", "Invalid dropoff type: $dropoffType")
|
|
177
|
+
return@launch
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
DoorstepAI.markDropoff(deliveryId, type)
|
|
181
|
+
promise.resolve(true)
|
|
182
|
+
} catch (e: Exception) {
|
|
183
|
+
promise.reject("DROP_OFF_ERROR", e.message ?: "Failed to mark dropoff")
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
144
188
|
@ReactMethod
|
|
145
189
|
fun stopDelivery(deliveryId: String, promise: Promise) {
|
|
146
190
|
try {
|
package/ios/DoorstepAI.mm
CHANGED
|
@@ -2,36 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
@interface RCT_EXTERN_MODULE(DoorstepAI, NSObject)
|
|
4
4
|
|
|
5
|
-
RCT_EXTERN_METHOD(setApiKey:(NSString *)apiKey)
|
|
6
|
-
RCT_EXTERN_METHOD(enableDevMode:(NSString *)apiKey
|
|
5
|
+
RCT_EXTERN_METHOD(setApiKey:(nonnull NSString *)apiKey)
|
|
6
|
+
RCT_EXTERN_METHOD(enableDevMode:(nonnull NSString *)apiKey
|
|
7
7
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
8
8
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
9
|
-
RCT_EXTERN_METHOD(startDeliveryByPlaceID:(NSString *)placeID
|
|
10
|
-
deliveryId:(NSString *)deliveryId
|
|
9
|
+
RCT_EXTERN_METHOD(startDeliveryByPlaceID:(nonnull NSString *)placeID
|
|
10
|
+
deliveryId:(nonnull NSString *)deliveryId
|
|
11
|
+
timeoutSeconds:(nullable NSNumber *)timeoutSeconds
|
|
11
12
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
12
13
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
13
|
-
RCT_EXTERN_METHOD(startDeliveryByPlusCode:(NSString *)plusCode
|
|
14
|
-
deliveryId:(NSString *)deliveryId
|
|
14
|
+
RCT_EXTERN_METHOD(startDeliveryByPlusCode:(nonnull NSString *)plusCode
|
|
15
|
+
deliveryId:(nonnull NSString *)deliveryId
|
|
16
|
+
timeoutSeconds:(nullable NSNumber *)timeoutSeconds
|
|
15
17
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
16
18
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
17
|
-
RCT_EXTERN_METHOD(startDeliveryByAddress:(NSDictionary *)address
|
|
18
|
-
deliveryId:(NSString *)deliveryId
|
|
19
|
+
RCT_EXTERN_METHOD(startDeliveryByAddress:(nonnull NSDictionary *)address
|
|
20
|
+
deliveryId:(nonnull NSString *)deliveryId
|
|
21
|
+
timeoutSeconds:(nullable NSNumber *)timeoutSeconds
|
|
19
22
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
20
23
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
21
|
-
RCT_EXTERN_METHOD(startDeliveryByAddressString:(NSString *)address
|
|
22
|
-
deliveryId:(NSString *)deliveryId
|
|
24
|
+
RCT_EXTERN_METHOD(startDeliveryByAddressString:(nonnull NSString *)address
|
|
25
|
+
deliveryId:(nonnull NSString *)deliveryId
|
|
26
|
+
timeoutSeconds:(nullable NSNumber *)timeoutSeconds
|
|
23
27
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
24
28
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
25
29
|
RCT_EXTERN_METHOD(startDeliveryByLatLng:(nonnull NSNumber *)latitude
|
|
26
30
|
longitude:(nonnull NSNumber *)longitude
|
|
27
|
-
|
|
31
|
+
subUnit:(nonnull NSString *)subUnit
|
|
32
|
+
deliveryId:(nonnull NSString *)deliveryId
|
|
33
|
+
timeoutSeconds:(nullable NSNumber *)timeoutSeconds
|
|
28
34
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
29
35
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
30
|
-
RCT_EXTERN_METHOD(newEvent:(NSString *)eventName
|
|
31
|
-
deliveryId:(NSString *)deliveryId
|
|
36
|
+
RCT_EXTERN_METHOD(newEvent:(nonnull NSString *)eventName
|
|
37
|
+
deliveryId:(nonnull NSString *)deliveryId
|
|
32
38
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
33
39
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
34
|
-
RCT_EXTERN_METHOD(
|
|
40
|
+
RCT_EXTERN_METHOD(markDropoff:(nonnull NSString *)deliveryId
|
|
41
|
+
dropoffType:(nonnull NSString *)dropoffType
|
|
42
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
43
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
44
|
+
RCT_EXTERN_METHOD(stopDelivery:(nonnull NSString *)deliveryId
|
|
35
45
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
36
46
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
37
47
|
RCT_EXTERN_METHOD(hasCachedData:(RCTPromiseResolveBlock)resolve
|
package/ios/DoorstepAI.swift
CHANGED
|
@@ -41,12 +41,18 @@ class DoorstepAIBridge: NSObject {
|
|
|
41
41
|
@objc
|
|
42
42
|
func startDeliveryByPlaceID(_ placeID: NSString,
|
|
43
43
|
deliveryId: NSString,
|
|
44
|
+
timeoutSeconds: NSNumber?,
|
|
44
45
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
45
46
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
46
47
|
// Use Swift's concurrency support to call the async method.
|
|
47
48
|
Task {
|
|
48
49
|
do {
|
|
49
|
-
|
|
50
|
+
let timeout = timeoutSeconds?.doubleValue
|
|
51
|
+
try await DoorstepAI.startDeliveryByPlaceID(
|
|
52
|
+
placeID: placeID as String,
|
|
53
|
+
deliveryId: deliveryId as String,
|
|
54
|
+
timeoutSeconds: timeout
|
|
55
|
+
)
|
|
50
56
|
resolve(nil)
|
|
51
57
|
} catch {
|
|
52
58
|
reject("E_START_DELIVERY", "Failed to start delivery by Place ID: \(error.localizedDescription)", error)
|
|
@@ -57,11 +63,17 @@ class DoorstepAIBridge: NSObject {
|
|
|
57
63
|
@objc
|
|
58
64
|
func startDeliveryByPlusCode(_ plusCode: NSString,
|
|
59
65
|
deliveryId: NSString,
|
|
66
|
+
timeoutSeconds: NSNumber?,
|
|
60
67
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
61
68
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
62
69
|
Task {
|
|
63
70
|
do {
|
|
64
|
-
|
|
71
|
+
let timeout = timeoutSeconds?.doubleValue
|
|
72
|
+
try await DoorstepAI.startDeliveryByPlusCode(
|
|
73
|
+
plusCode: plusCode as String,
|
|
74
|
+
deliveryId: deliveryId as String,
|
|
75
|
+
timeoutSeconds: timeout
|
|
76
|
+
)
|
|
65
77
|
resolve(nil)
|
|
66
78
|
} catch {
|
|
67
79
|
reject("E_START_DELIVERY", "Failed to start delivery by Plus Code: \(error.localizedDescription)", error)
|
|
@@ -72,11 +84,17 @@ class DoorstepAIBridge: NSObject {
|
|
|
72
84
|
@objc
|
|
73
85
|
func startDeliveryByAddressString(_ address: NSString,
|
|
74
86
|
deliveryId: NSString,
|
|
87
|
+
timeoutSeconds: NSNumber?,
|
|
75
88
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
76
89
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
77
90
|
Task {
|
|
78
91
|
do {
|
|
79
|
-
|
|
92
|
+
let timeout = timeoutSeconds?.doubleValue
|
|
93
|
+
try await DoorstepAI.startDeliveryByAddressString(
|
|
94
|
+
address: address as String,
|
|
95
|
+
deliveryId: deliveryId as String,
|
|
96
|
+
timeoutSeconds: timeout
|
|
97
|
+
)
|
|
80
98
|
resolve(nil)
|
|
81
99
|
} catch {
|
|
82
100
|
reject("E_START_DELIVERY", "Failed to start delivery by Address String: \(error.localizedDescription)", error)
|
|
@@ -87,12 +105,21 @@ class DoorstepAIBridge: NSObject {
|
|
|
87
105
|
@objc
|
|
88
106
|
func startDeliveryByLatLng(_ latitude: NSNumber,
|
|
89
107
|
longitude: NSNumber,
|
|
108
|
+
subUnit: NSString,
|
|
90
109
|
deliveryId: NSString,
|
|
110
|
+
timeoutSeconds: NSNumber?,
|
|
91
111
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
92
112
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
93
113
|
Task {
|
|
94
114
|
do {
|
|
95
|
-
|
|
115
|
+
let timeout = timeoutSeconds?.doubleValue
|
|
116
|
+
try await DoorstepAI.startDeliveryByLatLng(
|
|
117
|
+
latitude: latitude.doubleValue,
|
|
118
|
+
longitude: longitude.doubleValue,
|
|
119
|
+
subUnit: subUnit as String,
|
|
120
|
+
deliveryId: deliveryId as String,
|
|
121
|
+
timeoutSeconds: timeout
|
|
122
|
+
)
|
|
96
123
|
resolve(nil)
|
|
97
124
|
} catch {
|
|
98
125
|
reject("E_START_DELIVERY", "Failed to start delivery by LatLng: \(error.localizedDescription)", error)
|
|
@@ -103,6 +130,7 @@ class DoorstepAIBridge: NSObject {
|
|
|
103
130
|
@objc
|
|
104
131
|
func startDeliveryByAddress(_ address: [String: Any],
|
|
105
132
|
deliveryId: NSString,
|
|
133
|
+
timeoutSeconds: NSNumber?,
|
|
106
134
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
107
135
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
108
136
|
Task {
|
|
@@ -125,7 +153,12 @@ class DoorstepAIBridge: NSObject {
|
|
|
125
153
|
administrativeAreaLevel1: administrativeAreaLevel1,
|
|
126
154
|
postalCode: postalCode)
|
|
127
155
|
|
|
128
|
-
|
|
156
|
+
let timeout = timeoutSeconds?.doubleValue
|
|
157
|
+
try await DoorstepAI.startDeliveryByAddressType(
|
|
158
|
+
address: addressStruct,
|
|
159
|
+
deliveryId: deliveryId as String,
|
|
160
|
+
timeoutSeconds: timeout
|
|
161
|
+
)
|
|
129
162
|
resolve(nil)
|
|
130
163
|
} catch let error as DoorstepAIError {
|
|
131
164
|
reject("E_START_DELIVERY", "Failed to start delivery by address: \(error.localizedDescription)", error)
|
|
@@ -150,6 +183,32 @@ class DoorstepAIBridge: NSObject {
|
|
|
150
183
|
}
|
|
151
184
|
}
|
|
152
185
|
|
|
186
|
+
@objc
|
|
187
|
+
func markDropoff(_ deliveryId: NSString,
|
|
188
|
+
dropoffType: NSString,
|
|
189
|
+
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
190
|
+
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
191
|
+
Task {
|
|
192
|
+
do {
|
|
193
|
+
let normalized = (dropoffType as String).lowercased()
|
|
194
|
+
let type: DropoffType
|
|
195
|
+
switch normalized {
|
|
196
|
+
case "pod":
|
|
197
|
+
type = .pod
|
|
198
|
+
case "non_pod":
|
|
199
|
+
type = .non_pod
|
|
200
|
+
default:
|
|
201
|
+
reject("E_DROP_OFF_TYPE", "Invalid dropoff type: \(dropoffType)", nil)
|
|
202
|
+
return
|
|
203
|
+
}
|
|
204
|
+
try await DoorstepAI.markDropoff(deliveryId: deliveryId as String, dropoffType: type)
|
|
205
|
+
resolve(nil)
|
|
206
|
+
} catch {
|
|
207
|
+
reject("E_DROP_OFF", "Failed to mark dropoff: \(error.localizedDescription)", error)
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
153
212
|
@objc
|
|
154
213
|
func stopDelivery(_ deliveryId: NSString,
|
|
155
214
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
@@ -10,15 +10,18 @@
|
|
|
10
10
|
<key>DebugSymbolsPath</key>
|
|
11
11
|
<string>dSYMs</string>
|
|
12
12
|
<key>LibraryIdentifier</key>
|
|
13
|
-
<string>ios-
|
|
13
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
14
14
|
<key>LibraryPath</key>
|
|
15
15
|
<string>DoorstepDropoffSDK.framework</string>
|
|
16
16
|
<key>SupportedArchitectures</key>
|
|
17
17
|
<array>
|
|
18
18
|
<string>arm64</string>
|
|
19
|
+
<string>x86_64</string>
|
|
19
20
|
</array>
|
|
20
21
|
<key>SupportedPlatform</key>
|
|
21
22
|
<string>ios</string>
|
|
23
|
+
<key>SupportedPlatformVariant</key>
|
|
24
|
+
<string>simulator</string>
|
|
22
25
|
</dict>
|
|
23
26
|
<dict>
|
|
24
27
|
<key>BinaryPath</key>
|
|
@@ -26,18 +29,15 @@
|
|
|
26
29
|
<key>DebugSymbolsPath</key>
|
|
27
30
|
<string>dSYMs</string>
|
|
28
31
|
<key>LibraryIdentifier</key>
|
|
29
|
-
<string>ios-
|
|
32
|
+
<string>ios-arm64</string>
|
|
30
33
|
<key>LibraryPath</key>
|
|
31
34
|
<string>DoorstepDropoffSDK.framework</string>
|
|
32
35
|
<key>SupportedArchitectures</key>
|
|
33
36
|
<array>
|
|
34
37
|
<string>arm64</string>
|
|
35
|
-
<string>x86_64</string>
|
|
36
38
|
</array>
|
|
37
39
|
<key>SupportedPlatform</key>
|
|
38
40
|
<string>ios</string>
|
|
39
|
-
<key>SupportedPlatformVariant</key>
|
|
40
|
-
<string>simulator</string>
|
|
41
41
|
</dict>
|
|
42
42
|
</array>
|
|
43
43
|
<key>CFBundlePackageType</key>
|