Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user _id to createTrip #329

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

lmeier
Copy link
Contributor

@lmeier lmeier commented Apr 18, 2024

@lmeier lmeier requested a review from york-wei April 18, 2024 20:27
@york-wei
Copy link
Contributor

@lmeier it looks like trip options is just set to the one passed in the startTrip, I think we need to create a new one with the returned trip's externalId

+ (void)startTripWithOptions:(RadarTripOptions *)tripOptions
             trackingOptions:(RadarTrackingOptions *)trackingOptions
           completionHandler:(RadarTripCompletionHandler)completionHandler {
    [[RadarLogger sharedInstance] logWithLevel:RadarLogLevelInfo type:RadarLogTypeSDKCall message:@"startTrip()"];
    [[RadarAPIClient sharedInstance] createTripWithOptions:tripOptions
                                         completionHandler:^(RadarStatus status, RadarTrip *trip, NSArray<RadarEvent *> *events) {
                                             if (status == RadarStatusSuccess) {
                                                 [RadarSettings setTripOptions:tripOptions];

Copy link
Contributor

@york-wei york-wei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we need to update the RadarTrip class to include scheduledArrivalAt and parse it from the JSON payload

@lmeier lmeier requested a review from corypisano April 22, 2024 20:46
@@ -25,7 +25,9 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithExternalId:(NSString *_Nonnull)externalId
destinationGeofenceTag:(NSString *_Nullable)destinationGeofenceTag
destinationGeofenceExternalId:(NSString *_Nullable)destinationGeofenceExternalId
scheduledArrivalAt:(NSDate *_Nullable)scheduledArrivalAt;
scheduledArrivalAt:(NSDate *_Nullable)scheduledArrivalAt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a breaking change, would we need migration docs?

A follow up question is, do we want to keep on exposing these "init by fields" functions when we already expose the "init by dictionary" functions as we revamp the SDK for one line implementation? The upside would be that we will no longer be collecting deprecated interfaces. The downside would be that initializing from dictionary in native is kinda annoying and not developer friendly. However, one may also claim that with one line implementation all of these options that developers are currently building and loading into the client should be loaded in from the server.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, we shouldn't break this here. I'll either introduce another option with the 2 additional params or create a dictionary based initialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants