Skip to content

Commit

Permalink
Add blocked to fraud (#353)
Browse files Browse the repository at this point in the history
* add blocked and sharing field

* update example log text

* bump version
  • Loading branch information
ShiCheng-Lu authored Jun 24, 2024
1 parent d71d097 commit 953ff19
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
Radar.getContext { (status, location, context) in
print("Context: status = \(Radar.stringForStatus(status)); location = \(String(describing: location)); context?.geofences = \(String(describing: context?.geofences)); context?.place = \(String(describing: context?.place)); context?.country = \(String(describing: context?.country))")
}

Radar.trackVerified() { (status, token) in
print("TrackVerified: status = \(status); token = \(token?.dictionaryValue())")
}

// In the Radar dashboard settings
// (https://radar.com/dashboard/settings), add this to the chain
Expand Down
2 changes: 1 addition & 1 deletion RadarSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'RadarSDK'
s.version = '3.13.4'
s.version = '3.13.5'
s.summary = 'iOS SDK for Radar, the leading geofencing and location tracking platform'
s.homepage = 'https://radar.com'
s.author = { 'Radar Labs, Inc.' => 'support@radar.com' }
Expand Down
4 changes: 2 additions & 2 deletions RadarSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MARKETING_VERSION = 3.13.4;
MARKETING_VERSION = 3.13.5;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -1083,7 +1083,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MARKETING_VERSION = 3.13.4;
MARKETING_VERSION = 3.13.5;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_CFLAGS = "-fembed-bitcode";
Expand Down
11 changes: 11 additions & 0 deletions RadarSDK/Include/RadarFraud.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@
*/
@property (assign, nonatomic, readonly) bool inaccurate;

/**
A boolean indicating whether the user's location is not accurate enough. May be `false` if Fraud is not enabled.
*/
@property (assign, nonatomic, readonly) bool sharing;

/**
A boolean indicating whether the user has been manually blocked. May be `false` if Fraud is not enabled.
*/
@property (assign, nonatomic, readonly) bool blocked;


- (NSDictionary *_Nonnull)dictionaryValue;

@end
5 changes: 4 additions & 1 deletion RadarSDK/RadarFraud+Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ NS_ASSUME_NONNULL_BEGIN
mocked:(BOOL)mocked
compromised:(BOOL)compromised
jumped:(BOOL)jumped
inaccurate:(BOOL)inaccurate;
inaccurate:(BOOL)inaccurate
sharing:(BOOL)sharing
blocked:(BOOL)blocked;

- (instancetype _Nullable)initWithObject:(id _Nonnull)object;

@end
Expand Down
12 changes: 10 additions & 2 deletions RadarSDK/RadarFraud.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ - (instancetype _Nonnull)initWithPassed:(BOOL)passed
mocked:(BOOL)mocked
compromised:(BOOL)compromised
jumped:(BOOL)jumped
inaccurate:(BOOL)inaccurate {
inaccurate:(BOOL)inaccurate
sharing:(BOOL)sharing
blocked:(BOOL)blocked {
_passed = passed;
_bypassed = bypassed;
_verified = verified;
Expand All @@ -25,6 +27,8 @@ - (instancetype _Nonnull)initWithPassed:(BOOL)passed
_compromised = compromised;
_jumped = jumped;
_inaccurate = inaccurate;
_sharing = sharing;
_blocked = blocked;

return self;
}
Expand All @@ -44,6 +48,8 @@ - (instancetype _Nullable)initWithObject:(id)object {
_compromised = [self asBool:dict[@"compromised"]];
_jumped = [self asBool:dict[@"jumped"]];
_inaccurate = [self asBool:dict[@"inaccurate"]];
_sharing = [self asBool:dict[@"sharing"]];
_blocked = [self asBool:dict[@"blocked"]];

return self;
}
Expand All @@ -57,7 +63,9 @@ - (NSDictionary *)dictionaryValue {
@"mocked": @(self.mocked),
@"compromised": @(self.compromised),
@"jumped": @(self.jumped),
@"inaccurate": @(self.inaccurate)
@"inaccurate": @(self.inaccurate),
@"sharing": @(self.sharing),
@"blocked": @(self.blocked),
};
}

Expand Down
2 changes: 1 addition & 1 deletion RadarSDK/RadarUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ + (NSNumber *)timeZoneOffset {
}

+ (NSString *)sdkVersion {
return @"3.13.4";
return @"3.13.5";
}

+ (NSString *)deviceId {
Expand Down

0 comments on commit 953ff19

Please sign in to comment.