Skip to content

Commit

Permalink
Single-line changes to remove notification checks in the background c…
Browse files Browse the repository at this point in the history
…hecker

As part of e-mission/e-mission-docs#1094, we made the
notification permission optional.

Since it is not required for silent push notifications, notifications are
nice-to-have. They are still helpful to ensure that people know if there are
issues, and hopefully help them label their trips, but the app will still work
if the permission is turned off.

Since this is no longer required for normal operation, we don't need to check
it in the background every hour, and nag the user to fix it if it is turned off.
This is a super-easy change (two lines), so rolling this in while fixing
e-mission/e-mission-docs#1094 instead of coming in as
a future fix.

Testing done:
- Replaced the data collection plugin with the most recent version
- Code compiles
- Wasn't able to test in the emulator since with the permission turned off, without
    e-mission/e-mission-phone#1182 in place, we got a
    prompt to fix the notification, so we couldn't simulate a remote push

Pushing this and testing all the changes together
  • Loading branch information
shankari committed Oct 7, 2024
1 parent b0850bf commit ca208b5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public static void checkAppState(final Context ctxt) {
SensorControlChecks.checkLocationPermissions(ctxt),
SensorControlChecks.checkIgnoreBatteryOptimizations(ctxt),
SensorControlChecks.checkMotionActivityPermissions(ctxt),
SensorControlChecks.checkNotificationsEnabled(ctxt),
};
boolean allOtherChecksPass = true;
for (boolean check: allOtherChecks) {
Expand Down
3 changes: 1 addition & 2 deletions src/ios/Verification/SensorControlBackgroundChecker.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ +(void)checkAppState
@([TripDiarySensorControlChecks checkLocationSettings]),
@([TripDiarySensorControlChecks checkLocationPermissions]),
@([TripDiarySensorControlChecks checkMotionActivitySettings]),
@([TripDiarySensorControlChecks checkMotionActivityPermissions]),
@([TripDiarySensorControlChecks checkNotificationsEnabled])
@([TripDiarySensorControlChecks checkMotionActivityPermissions])
];
BOOL allChecksPass = TRUE;
for (NSNumber* check in allChecks) {
Expand Down

0 comments on commit ca208b5

Please sign in to comment.