-
Notifications
You must be signed in to change notification settings - Fork 27
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
indoors #370
base: master
Are you sure you want to change the base?
indoors #370
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some naming ideas and style nits
<key>NSBluetoothAlwaysUsageDescription</key> | ||
<string>Please enable Bluetooth for indoors location</string> | ||
<key>NSBluetoothPeripheralUsageDescription</key> | ||
<string>Please enable Bluetooth for indoors location</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: @KennyHuRadar's Info.plist
will obviate the need for this
@@ -1086,6 +1089,12 @@ logConversionWithNotification | |||
units:(RadarRouteUnits)units | |||
completionHandler:(RadarRouteMatrixCompletionHandler)completionHandler NS_SWIFT_NAME(getMatrix(origins:destinations:mode:units:completionHandler:)); | |||
|
|||
#pragma mark - Indoors | |||
|
|||
+ (void)doIndoorSurvey:(NSString *)placeLabel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ (void)doIndoorSurvey:(NSString *)placeLabel | |
+ (void)surveyIndoors:(NSString *)placeLabel |
or something of the like is more in-line with our naming conventions.
RadarEventTypeUserFailedFraud NS_SWIFT_NAME(userFailedFraud) | ||
RadarEventTypeUserFailedFraud NS_SWIFT_NAME(userFailedFraud), | ||
/// `user.indoor_location` | ||
RadarEventTypeIndoorLocation NS_SWIFT_NAME(indoorLocation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want a new event type here? I think instead we're likely to prefer something like an optional originalLocation
on location
s
@@ -154,6 +154,8 @@ typedef NS_ENUM(NSInteger, RadarTrackingOptionsSyncLocations) { | |||
*/ | |||
@property (nonatomic, assign) BOOL beacons; | |||
|
|||
@property (nonatomic, assign) BOOL indoors; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bigger philosophical naming question: we might want to use the techniques here in contexts that aren't actually indoors (e.g. open air malls, around the covered perimeter of buildings, etc) — would we potentially want to name this something like precise
?
@@ -173,13 +173,15 @@ - (void)trackWithLocation:(CLLocation *_Nonnull)location | |||
source:(RadarLocationSource)source | |||
replayed:(BOOL)replayed | |||
beacons:(NSArray<RadarBeacon *> *_Nullable)beacons | |||
indoorsWhereAmIScan:(NSString *)indoorsWhereAmIScan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indoorsWhereAmIScan:(NSString *)indoorsWhereAmIScan | |
indoorsScan:(NSString *)indoorsScan |
or maybe environmentScan
?
// in indoors mode, override accuracy | ||
RadarTrackingOptions *options = [Radar getTrackingOptions]; | ||
if(options.indoors){ | ||
locationAccuracyNumber = [NSNumber numberWithFloat:10.0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to do this server side. Best to not just throw away the data point
RadarTrackingOptions *options = [Radar getTrackingOptions]; | ||
BOOL wasStopped = [RadarState stopped]; | ||
BOOL stopped = NO; | ||
|
||
BOOL force = (source == RadarLocationSourceForegroundLocation || source == RadarLocationSourceManualLocation || source == RadarLocationSourceBeaconEnter || | ||
source == RadarLocationSourceBeaconExit || source == RadarLocationSourceVisitArrival); | ||
|
||
if(options.indoors) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(options.indoors) { | |
if (options.indoors) { |
[[RadarIndoorSurvey sharedInstance] start:@"WHEREAMI" | ||
forLength:WHERE_AM_I_DURATION_SECONDS | ||
withKnownLocation:location | ||
isWhereAmIScan:YES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isWhereAmIScan:YES | |
isEnvironmentScan:YES |
or isIndoorsScan
potentially?
@@ -898,11 +949,11 @@ - (void)sendLocation:(CLLocation *)location stopped:(BOOL)stopped source:(RadarL | |||
[[RadarBeaconManager sharedInstance] rangeBeaconUUIDs:beaconUUIDs | |||
completionHandler:^(RadarStatus status, NSArray<RadarBeacon *> *_Nullable beacons) { | |||
if (status != RadarStatusSuccess || !beacons) { | |||
callTrackAPI(nil); | |||
maybeIndoorSurveyThenCallTrackAPI(nil); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybeIndoorSurveyThenCallTrackAPI(nil); | |
maybeSurveyIndoorsThenCallTrackAPI(nil); |
No description provided.