react-native-radar 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/radar/RadarModuleImpl.java +110 -0
- package/android/src/newarch/java/com/radar/RadarModule.kt +45 -2
- package/android/src/oldarch/java/com/radar/RadarModule.java +56 -2
- package/dist/@types/RadarNativeInterface.d.ts +9 -2
- package/dist/@types/types.d.ts +47 -6
- package/dist/NativeRadar.d.ts +8 -1
- package/dist/index.native.js +35 -3
- package/dist/index.web.d.ts +6 -0
- package/dist/index.web.js +17 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/ios/RNRadar.mm +155 -3
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/Radar.h +108 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarBeacon.h +10 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarCoordinate.h +1 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarGeofence.h +10 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarInitializeOptions.h +0 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarSDK-Swift.h +101 -7
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarSDK.h +1 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarSDKFraudProtocol.h +26 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarSdkConfiguration.h +23 -28
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarTrackingOptions.h +20 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarTrip.h +15 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarTripLeg.h +268 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarTripOptions.h +6 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarTripOrder.h +1 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarUser.h +2 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Info.plist +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios.abi.json +1702 -209
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Modules/module.modulemap +0 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/RadarSDK +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/Radar.h +108 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarBeacon.h +10 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarCoordinate.h +1 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarGeofence.h +10 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarInitializeOptions.h +0 -1
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarSDK-Swift.h +204 -16
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarSDK.h +1 -1
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarSDKFraudProtocol.h +26 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarSdkConfiguration.h +23 -28
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarTrackingOptions.h +20 -1
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarTrip.h +15 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarTripLeg.h +268 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarTripOptions.h +6 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarTripOrder.h +1 -1
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarUser.h +2 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Info.plist +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +1702 -209
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +1702 -209
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/module.modulemap +0 -1
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/RadarSDK +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/_CodeSignature/CodeResources +71 -60
- package/ios/RadarSDKMotion.xcframework/ios-arm64/RadarSDKMotion.framework/Headers/RadarSDKMotion.h +0 -2
- package/ios/RadarSDKMotion.xcframework/ios-arm64/RadarSDKMotion.framework/Info.plist +0 -0
- package/ios/RadarSDKMotion.xcframework/ios-arm64/RadarSDKMotion.framework/RadarSDKMotion +0 -0
- package/ios/RadarSDKMotion.xcframework/ios-arm64_x86_64-simulator/RadarSDKMotion.framework/Headers/RadarSDKMotion.h +0 -2
- package/ios/RadarSDKMotion.xcframework/ios-arm64_x86_64-simulator/RadarSDKMotion.framework/Info.plist +0 -0
- package/ios/RadarSDKMotion.xcframework/ios-arm64_x86_64-simulator/RadarSDKMotion.framework/RadarSDKMotion +0 -0
- package/ios/RadarSDKMotion.xcframework/ios-arm64_x86_64-simulator/RadarSDKMotion.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RadarSDKMotion.xcframework/ios-arm64_x86_64-simulator/RadarSDKMotion.framework/_CodeSignature/CodeResources +3 -3
- package/package.json +2 -2
- package/src/@types/RadarNativeInterface.ts +11 -2
- package/src/@types/maplibre-react-native.d.ts +1 -14
- package/src/@types/types.ts +65 -7
- package/src/NativeRadar.ts +8 -1
- package/src/index.native.ts +42 -3
- package/src/index.web.js +17 -0
- package/src/version.ts +1 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/Radar-Swift.h +0 -7
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/Radar-Swift.h +0 -7
package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarTrackingOptions.h
CHANGED
|
@@ -43,7 +43,19 @@ typedef NS_ENUM(NSInteger, RadarTrackingOptionsSyncLocations) {
|
|
|
43
43
|
/// Syncs only stops and exits to the server
|
|
44
44
|
RadarTrackingOptionsSyncStopsAndExits,
|
|
45
45
|
/// Syncs no location updates to the server
|
|
46
|
-
RadarTrackingOptionsSyncNone
|
|
46
|
+
RadarTrackingOptionsSyncNone,
|
|
47
|
+
/// Syncs only on detected events (geofence, place, beacon changes)
|
|
48
|
+
RadarTrackingOptionsSyncEvents
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
The type of tracking options.
|
|
53
|
+
*/
|
|
54
|
+
typedef NS_ENUM(NSInteger, RadarTrackingOptionsType) {
|
|
55
|
+
RadarTrackingOptionsTypeDefault,
|
|
56
|
+
RadarTrackingOptionsTypeOnTrip,
|
|
57
|
+
RadarTrackingOptionsTypeInGeofence,
|
|
58
|
+
RadarTrackingOptionsTypeIsUser
|
|
47
59
|
};
|
|
48
60
|
|
|
49
61
|
/**
|
|
@@ -169,6 +181,11 @@ typedef NS_ENUM(NSInteger, RadarTrackingOptionsSyncLocations) {
|
|
|
169
181
|
*/
|
|
170
182
|
@property (nonatomic, assign) BOOL usePressure;
|
|
171
183
|
|
|
184
|
+
/**
|
|
185
|
+
The type of tracking options.
|
|
186
|
+
*/
|
|
187
|
+
@property (nonatomic, assign) RadarTrackingOptionsType type;
|
|
188
|
+
|
|
172
189
|
/**
|
|
173
190
|
Updates about every 30 seconds while moving or stopped. Moderate battery usage. Shows the flashing blue status bar during tracking.
|
|
174
191
|
@see https://developer.apple.com/documentation/corelocation/cllocationmanager/2923541-showsbackgroundlocationindicator
|
|
@@ -197,6 +214,8 @@ typedef NS_ENUM(NSInteger, RadarTrackingOptionsSyncLocations) {
|
|
|
197
214
|
+ (NSString *)stringForSyncLocations:(RadarTrackingOptionsSyncLocations)syncLocations;
|
|
198
215
|
+ (RadarTrackingOptionsSyncLocations)syncLocationsForString:(NSString *)str;
|
|
199
216
|
+ (RadarTrackingOptions *_Nullable)trackingOptionsFromDictionary:(NSDictionary *_Nonnull)dictionary;
|
|
217
|
+
+ (NSString *)stringForType:(RadarTrackingOptionsType)type;
|
|
218
|
+
+ (RadarTrackingOptionsType)typeForString:(NSString *)str;
|
|
200
219
|
- (NSDictionary *)dictionaryValue;
|
|
201
220
|
|
|
202
221
|
@end
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#import "RadarCoordinate.h"
|
|
9
9
|
#import "RadarRouteMode.h"
|
|
10
|
+
#import "RadarTripLeg.h"
|
|
10
11
|
#import "RadarTripOrder.h"
|
|
11
12
|
#import <Foundation/Foundation.h>
|
|
12
13
|
|
|
@@ -92,6 +93,20 @@ typedef NS_ENUM(NSInteger, RadarTripStatus) {
|
|
|
92
93
|
*/
|
|
93
94
|
@property (nullable, copy, nonatomic, readonly) NSArray<RadarTripOrder *> *orders;
|
|
94
95
|
|
|
96
|
+
/**
|
|
97
|
+
For multi-destination trips, the array of trip legs.
|
|
98
|
+
Each leg contains destination info, status, and metadata.
|
|
99
|
+
Use leg._id when calling updateTripLeg.
|
|
100
|
+
*/
|
|
101
|
+
@property (nullable, copy, nonatomic, readonly) NSArray<RadarTripLeg *> *legs;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
For multi-destination trips, the ID of the current active leg.
|
|
105
|
+
*/
|
|
106
|
+
@property (nullable, copy, nonatomic, readonly) NSString *currentLegId;
|
|
107
|
+
|
|
95
108
|
- (NSDictionary *_Nonnull)dictionaryValue;
|
|
96
109
|
|
|
110
|
+
- (instancetype _Nullable)initWithObject:(id _Nonnull)object;
|
|
111
|
+
|
|
97
112
|
@end
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RadarTripLeg.h
|
|
3
|
+
// RadarSDK
|
|
4
|
+
//
|
|
5
|
+
// Created by Alan Charles on 2/23/26.
|
|
6
|
+
// Copyright © 2026 Radar Labs, Inc. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import <CoreLocation/CoreLocation.h>
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
The status values for trip legs.
|
|
16
|
+
*/
|
|
17
|
+
typedef NS_ENUM(NSInteger, RadarTripLegStatus) {
|
|
18
|
+
/// Unknown
|
|
19
|
+
RadarTripLegStatusUnknown NS_SWIFT_NAME(unknown),
|
|
20
|
+
/// Pending
|
|
21
|
+
RadarTripLegStatusPending NS_SWIFT_NAME(pending),
|
|
22
|
+
/// Started
|
|
23
|
+
RadarTripLegStatusStarted NS_SWIFT_NAME(started),
|
|
24
|
+
/// Approaching
|
|
25
|
+
RadarTripLegStatusApproaching NS_SWIFT_NAME(approaching),
|
|
26
|
+
/// Arrived
|
|
27
|
+
RadarTripLegStatusArrived NS_SWIFT_NAME(arrived),
|
|
28
|
+
/// Completed
|
|
29
|
+
RadarTripLegStatusCompleted NS_SWIFT_NAME(completed),
|
|
30
|
+
/// Canceled
|
|
31
|
+
RadarTripLegStatusCanceled NS_SWIFT_NAME(canceled),
|
|
32
|
+
/// Expired
|
|
33
|
+
RadarTripLegStatusExpired NS_SWIFT_NAME(expired)
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
The destination type values for trip legs.
|
|
38
|
+
*/
|
|
39
|
+
typedef NS_ENUM(NSInteger, RadarTripLegDestinationType) {
|
|
40
|
+
/// Unknown
|
|
41
|
+
RadarTripLegDestinationTypeUnknown NS_SWIFT_NAME(unknown),
|
|
42
|
+
/// Geofence
|
|
43
|
+
RadarTripLegDestinationTypeGeofence NS_SWIFT_NAME(geofence),
|
|
44
|
+
/// Address
|
|
45
|
+
RadarTripLegDestinationTypeAddress NS_SWIFT_NAME(address),
|
|
46
|
+
/// Coordinates
|
|
47
|
+
RadarTripLegDestinationTypeCoordinates NS_SWIFT_NAME(coordinates)
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
Represents a leg of a multi-destination trip.
|
|
52
|
+
|
|
53
|
+
@see https://radar.com/documentation/trip-tracking
|
|
54
|
+
*/
|
|
55
|
+
@interface RadarTripLeg : NSObject
|
|
56
|
+
|
|
57
|
+
#pragma mark - Response Properties (populated from server response)
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
The Radar ID of the leg. Set from server response.
|
|
61
|
+
Use this when calling updateTripLeg.
|
|
62
|
+
*/
|
|
63
|
+
@property (nullable, nonatomic, copy, readonly) NSString *_id;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
The status of the leg. Set from server response.
|
|
67
|
+
*/
|
|
68
|
+
@property (nonatomic, assign, readonly) RadarTripLegStatus status;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
The destination type for this leg.
|
|
72
|
+
When parsed from a server response, reflects the server's `destination.type`.
|
|
73
|
+
Otherwise, inferred from which properties are set (geofence > address > coordinates).
|
|
74
|
+
*/
|
|
75
|
+
@property (nonatomic, assign, readonly) RadarTripLegDestinationType destinationType;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
The date when the leg was created. Set from server response.
|
|
79
|
+
*/
|
|
80
|
+
@property (nullable, nonatomic, copy, readonly) NSDate *createdAt;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
The date when the leg was last updated. Set from server response.
|
|
84
|
+
*/
|
|
85
|
+
@property (nullable, nonatomic, copy, readonly) NSDate *updatedAt;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
The ETA duration in minutes to this leg's destination. Set from server response.
|
|
89
|
+
*/
|
|
90
|
+
@property (nonatomic, assign, readonly) float etaDuration;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
The ETA distance in meters to this leg's destination. Set from server response.
|
|
94
|
+
*/
|
|
95
|
+
@property (nonatomic, assign, readonly) float etaDistance;
|
|
96
|
+
|
|
97
|
+
#pragma mark - Geofence Destination Properties
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
The tag of the destination geofence for this leg.
|
|
101
|
+
Use with destinationGeofenceExternalId for geofence-based destinations.
|
|
102
|
+
*/
|
|
103
|
+
@property (nullable, nonatomic, copy) NSString *destinationGeofenceTag;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
The external ID of the destination geofence for this leg.
|
|
107
|
+
Use with destinationGeofenceTag for geofence-based destinations.
|
|
108
|
+
*/
|
|
109
|
+
@property (nullable, nonatomic, copy) NSString *destinationGeofenceExternalId;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
The Radar ID of the destination geofence for this leg.
|
|
113
|
+
Alternative to using destinationGeofenceTag + destinationGeofenceExternalId.
|
|
114
|
+
*/
|
|
115
|
+
@property (nullable, nonatomic, copy) NSString *destinationGeofenceId;
|
|
116
|
+
|
|
117
|
+
#pragma mark - Address Destination Properties
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
The address string for the destination of this leg.
|
|
121
|
+
Use for address-based destinations.
|
|
122
|
+
*/
|
|
123
|
+
@property (nullable, nonatomic, copy) NSString *address;
|
|
124
|
+
|
|
125
|
+
#pragma mark - Coordinate Destination Properties
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
The coordinates for the destination of this leg.
|
|
129
|
+
Use for coordinate-based destinations. Set latitude and longitude.
|
|
130
|
+
*/
|
|
131
|
+
@property (nonatomic, assign) CLLocationCoordinate2D coordinates;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
Whether coordinates have been explicitly set.
|
|
135
|
+
*/
|
|
136
|
+
@property (nonatomic, assign, readonly) BOOL hasCoordinates;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
The arrival radius in meters for coordinate-based destinations.
|
|
140
|
+
Only used when coordinates are set.
|
|
141
|
+
*/
|
|
142
|
+
@property (nonatomic, assign) NSInteger arrivalRadius;
|
|
143
|
+
|
|
144
|
+
#pragma mark - Common Properties
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
The stop duration in minutes for this leg.
|
|
148
|
+
*/
|
|
149
|
+
@property (nonatomic, assign) NSInteger stopDuration;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
An optional set of custom key-value pairs for this leg.
|
|
153
|
+
*/
|
|
154
|
+
@property (nullable, nonatomic, copy) NSDictionary *metadata;
|
|
155
|
+
|
|
156
|
+
#pragma mark - Initializers
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
Initializes a RadarTripLeg with the specified destination geofence tag and external ID.
|
|
160
|
+
|
|
161
|
+
@param destinationGeofenceTag The tag of the destination geofence.
|
|
162
|
+
@param destinationGeofenceExternalId The external ID of the destination geofence.
|
|
163
|
+
|
|
164
|
+
@return A new RadarTripLeg instance.
|
|
165
|
+
*/
|
|
166
|
+
- (instancetype)initWithDestinationGeofenceTag:(NSString *_Nullable)destinationGeofenceTag
|
|
167
|
+
destinationGeofenceExternalId:(NSString *_Nullable)destinationGeofenceExternalId;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
Initializes a RadarTripLeg with the specified destination geofence ID.
|
|
171
|
+
|
|
172
|
+
@param destinationGeofenceId The Radar ID of the destination geofence.
|
|
173
|
+
|
|
174
|
+
@return A new RadarTripLeg instance.
|
|
175
|
+
*/
|
|
176
|
+
- (instancetype)initWithDestinationGeofenceId:(NSString *_Nonnull)destinationGeofenceId;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
Initializes a RadarTripLeg with the specified address.
|
|
180
|
+
|
|
181
|
+
@param address The address string for the destination.
|
|
182
|
+
|
|
183
|
+
@return A new RadarTripLeg instance.
|
|
184
|
+
*/
|
|
185
|
+
- (instancetype)initWithAddress:(NSString *_Nonnull)address;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
Initializes a RadarTripLeg with the specified coordinates.
|
|
189
|
+
|
|
190
|
+
@param coordinates The coordinates for the destination.
|
|
191
|
+
|
|
192
|
+
@return A new RadarTripLeg instance.
|
|
193
|
+
*/
|
|
194
|
+
- (instancetype)initWithCoordinates:(CLLocationCoordinate2D)coordinates;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
Creates a RadarTripLeg from a dictionary representation.
|
|
198
|
+
|
|
199
|
+
@param dict The dictionary containing leg data.
|
|
200
|
+
|
|
201
|
+
@return A new RadarTripLeg instance, or nil if the dictionary is invalid.
|
|
202
|
+
*/
|
|
203
|
+
+ (RadarTripLeg *_Nullable)legFromDictionary:(NSDictionary *_Nullable)dict;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
Creates an array of RadarTripLeg objects from an array of dictionaries.
|
|
207
|
+
|
|
208
|
+
@param array The array of dictionaries containing leg data.
|
|
209
|
+
|
|
210
|
+
@return An array of RadarTripLeg instances, or nil if the array is invalid.
|
|
211
|
+
*/
|
|
212
|
+
+ (NSArray<RadarTripLeg *> *_Nullable)legsFromArray:(NSArray *_Nullable)array;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
Converts the leg to a dictionary representation for API serialization.
|
|
216
|
+
|
|
217
|
+
@return A dictionary representation of the leg.
|
|
218
|
+
*/
|
|
219
|
+
- (NSDictionary *)dictionaryValue;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
Converts an array of legs to an array of dictionaries.
|
|
223
|
+
|
|
224
|
+
@param legs The array of RadarTripLeg instances.
|
|
225
|
+
|
|
226
|
+
@return An array of dictionary representations.
|
|
227
|
+
*/
|
|
228
|
+
+ (NSArray<NSDictionary *> *_Nullable)arrayForLegs:(NSArray<RadarTripLeg *> *_Nullable)legs;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
Returns the string representation of a trip leg status.
|
|
232
|
+
|
|
233
|
+
@param status The trip leg status.
|
|
234
|
+
|
|
235
|
+
@return The string representation.
|
|
236
|
+
*/
|
|
237
|
+
+ (NSString *)stringForStatus:(RadarTripLegStatus)status;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
Returns the trip leg status for a string representation.
|
|
241
|
+
|
|
242
|
+
@param string The string representation.
|
|
243
|
+
|
|
244
|
+
@return The trip leg status.
|
|
245
|
+
*/
|
|
246
|
+
+ (RadarTripLegStatus)statusForString:(NSString *)string;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
Returns the string representation of a trip leg destination type.
|
|
250
|
+
|
|
251
|
+
@param destinationType The trip leg destination type.
|
|
252
|
+
|
|
253
|
+
@return The string representation.
|
|
254
|
+
*/
|
|
255
|
+
+ (NSString *)stringForDestinationType:(RadarTripLegDestinationType)destinationType;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
Returns the trip leg destination type for a string representation.
|
|
259
|
+
|
|
260
|
+
@param string The string representation.
|
|
261
|
+
|
|
262
|
+
@return The trip leg destination type.
|
|
263
|
+
*/
|
|
264
|
+
+ (RadarTripLegDestinationType)destinationTypeForString:(NSString *)string;
|
|
265
|
+
|
|
266
|
+
@end
|
|
267
|
+
|
|
268
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
9
9
|
|
|
10
10
|
#import "RadarRouteMode.h"
|
|
11
|
+
#import "RadarTripLeg.h"
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
NS_ASSUME_NONNULL_BEGIN
|
|
@@ -67,6 +68,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
67
68
|
|
|
68
69
|
@property (nonatomic, assign) BOOL startTracking;
|
|
69
70
|
|
|
71
|
+
/**
|
|
72
|
+
For multi-destination trips, an optional array of trip legs.
|
|
73
|
+
*/
|
|
74
|
+
@property (nullable, nonatomic, copy) NSArray<RadarTripLeg *> *legs;
|
|
75
|
+
|
|
70
76
|
+ (RadarTripOptions *_Nullable)tripOptionsFromDictionary:(NSDictionary *)dict;
|
|
71
77
|
- (NSDictionary *)dictionaryValue;
|
|
72
78
|
|
|
Binary file
|