Skip to content

Commit

Permalink
rename to trackVerifiedToken(), revert sample app code
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpatrick committed Aug 21, 2023
1 parent eb135b1 commit be700de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
8 changes: 1 addition & 7 deletions Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
self.requestLocationPermissions()

// Replace with a valid test publishable key
Radar.initialize(publishableKey: "org_test_pk_5857c63d9c1565175db8b00750808a66a002acb8")
Radar.initialize(publishableKey: "prj_test_pk_0000000000000000000000000000000000000000")
Radar.setDelegate(self)

Radar.trackVerified { status, location, events, user in

}

/*
if UIApplication.shared.applicationState != .background {
Radar.getLocation { (status, location, stopped) in
print("Location: status = \(Radar.stringForStatus(status)); location = \(String(describing: location))")
Expand Down Expand Up @@ -164,7 +159,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD

print("Log Conversion: status = \(Radar.stringForStatus(status)); event = \(String(describing: event))")
}
*/

return true
}
Expand Down
10 changes: 5 additions & 5 deletions RadarSDK/Include/Radar.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ typedef void (^_Nullable RadarBeaconCompletionHandler)(RadarStatus status, NSArr
typedef void (^_Nullable RadarTrackCompletionHandler)(RadarStatus status, CLLocation *_Nullable location, NSArray<RadarEvent *> *_Nullable events, RadarUser *_Nullable user);

/**
Called when an encrypted track request succeeds, fails, or times out.
Called when an track request with token callback succeeds, fails, or times out.
Receives the request status and, if successful, a JSON Web Token (JWT) containing an array of the events generated and the user. Decrypt the JWT server-side using your private key.
Receives the request status and, if successful, a JSON Web Token (JWT) containing an array of the events generated and the user. Verify the JWT server-side using your secret key.
@see https://radar.com/documentation/sdk/ios
*/
typedef void (^_Nullable RadarTrackEncryptedCompletionHandler)(RadarStatus status, NSString *_Nullable token);
typedef void (^_Nullable RadarTrackTokenCompletionHandler)(RadarStatus status, NSString *_Nullable token);

/**
Called when a trip update succeeds, fails, or times out.
Expand Down Expand Up @@ -451,15 +451,15 @@ typedef void (^_Nonnull RadarLogConversionCompletionHandler)(RadarStatus status,
+ (void)trackVerifiedWithCompletionHandler:(RadarTrackCompletionHandler _Nullable)completionHandler NS_SWIFT_NAME(trackVerified(completionHandler:));

/**
Tracks the user's location with device integrity information for location verification use cases. Returns a JSON Web Token (JWT). Decrypt the JWT server-side using your private key.
Tracks the user's location with device integrity information for location verification use cases. Returns a JSON Web Token (JWT). Verify the JWT server-side using your secret key.
@warning Note that you must configure SSL pinning before calling this method.
@param completionHandler An optional completion handler.
@see https://radar.com/documentation/fraud
*/
+ (void)trackVerifiedEncryptedWithCompletionHandler:(RadarTrackEncryptedCompletionHandler _Nullable)completionHandler NS_SWIFT_NAME(trackVerifiedEncrypted(completionHandler:));
+ (void)trackVerifiedTokenWithCompletionHandler:(RadarTrackTokenCompletionHandler _Nullable)completionHandler NS_SWIFT_NAME(trackVerifiedToken(completionHandler:));

/**
Starts tracking the user's location in the background with configurable tracking options.
Expand Down
2 changes: 1 addition & 1 deletion RadarSDK/Radar.m
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ + (void)trackVerifiedWithCompletionHandler:(RadarTrackCompletionHandler)completi
}];
}

+ (void)trackVerifiedEncryptedWithCompletionHandler:(RadarTrackEncryptedCompletionHandler)completionHandler {
+ (void)trackVerifiedTokenWithCompletionHandler:(RadarTrackTokenCompletionHandler)completionHandler {
[[RadarAPIClient sharedInstance]
getConfigForUsage:@"verify" verified:YES
completionHandler:^(RadarStatus status, RadarConfig *_Nullable config) {
Expand Down

0 comments on commit be700de

Please sign in to comment.