Giter Club home page Giter Club logo

safeplaces-dct-app's Issues

VERIFY: Backfill Stationary point captures if needed

The BackgroundGeolocation library has the ability to only report changes in location when the user moves. This saves power in some cases, e.g. if the phone is sitting on a charger and not moving, the accelerometer shows it is stationary. The library saves power by returning a Stationary point.

Verify the behavior around this. I suspect it only generates a callback once, then stops calling until the phone moves again. If this happens, upon the move we should backfill so that we have the same point reported at 5 minute intervals until that next point report.

Example:

@3:01 - I set my phone down on the desk
@3:02 - The BackgroundGeolocation callback triggers and we save a coordinate
@3:40 - I move my phone
@3:40 - The BackgroundGeolocation callback triggers and we save a coordinate

If the above does occur (which we need to verify), we should save the same reported coordinate from 3:02 at 3:07, 3:12, 3:17, 3:22, 3:27, 3:32, 3:37 and then save the new 3:40 coordinate.

Update branding

Once the name is finalized, update the repo name, app strings, and any documentation that references "mobileapp"

Apple Rejection: Do we need Motion Tracking?

We noticed that your app requests the user’s consent to access their motion but does not clarify the use of the motion in the applicable purpose string.

Next Steps

Please revise the relevant purpose string in your app’s Info.plist file to specify why the app is requesting access to the user's motion and location. You can modify your app's Info.plist file using the property list editor in Xcode.

To help users understand why your app is requesting access to their personal data, all permission request alerts in your app should specify how your app will use the requested feature.

FEATURE: Verify application freshness

Add a mechanism to remind the user to update if they have turned off auto-updates on their phone.

The first version can be a simple notification when the app is outdated.

iOS not building on develop (45fc937419069a94dab3d4dd11deab4f33b080a0)

I am getting this error on the iOS build for develop 45fc937

It gets stuck on a white screen and the app fails to load. I tested release v0.5 and it worked.

Device iPhone 8 - iOS 13.3.1

2020-03-16 01:01:35.631 [info][tid:main][RNGestureHandlerManager.m:136] [GESTURE HANDLER] Initialize gesture handler for root view <RCTRootContentView: 0x1013049b0; reactTag: 1; frame = (0 0; 375 667); gestureRecognizers = <NSArray: 0x2800f1170>; layer = <CALayer: 0x280eb8ec0>>
2020-03-16 01:01:35.660749-0700 PrivateKit[438:28526] +backgroundSessionConfiguration: is deprecated. Please use +backgroundSessionConfigurationWithIdentifier: instead
2020-03-16 01:01:35:660 PrivateKit[438:28526] Backing up original handler.
2020-03-16 01:01:35:660 PrivateKit[438:28526] Setting new handler.
2020-03-16 01:01:35.693860-0700 PrivateKit[438:28526] Current db version: 3
2020-03-16 01:01:35:694 PrivateKit[438:28519] BgGeo #configure: Config: distanceFilter=50 stationaryRadius=50 desiredAccuracy=0 activityType=OtherNavigation activitiesInterval=10000 isDebugging=0 stopOnTerminate=0 url= syncThreshold=100 maxLocations=10000 httpHeaders={
} pauseLocationUpdates=0 saveBatteryOnBackground=0 locationProvider=1 postTemplate={
    foo = bar;
    lat = "@latitude";
    lon = "@longitude";
}
2020-03-16 01:01:35.695266-0700 PrivateKit[438:28523] BgGeo #configure: Config: distanceFilter=50 stationaryRadius=50 desiredAccuracy=0 activityType=OtherNavigation activitiesInterval=10000 isDebugging=0 stopOnTerminate=0 url= syncThreshold=100 maxLocations=10000 httpHeaders={
} pauseLocationUpdates=0 saveBatteryOnBackground=0 locationProvider=1 postTemplate={
    foo = bar;
    lat = "@latitude";
    lon = "@longitude";
}
2020-03-16 01:01:35.696687-0700 PrivateKit[438:28519] Configuration persisted succesfuly
2020-03-16 01:01:35.700 [error][tid:com.facebook.react.JavaScript] TypeError: s.registerHeadlessTask is not a function. (In 's.registerHeadlessTask(o,n)', 's.registerHeadlessTask' is undefined)

This error is located at:
    in n
    in Unknown
    in Unknown
    in Unknown
    in Unknown
    in RCTView
    in RCTView
    in RCTView
    in RCTView
    in u
    in PanGestureHandler
    in RCTView
    in u
    in RCTView
    in n
    in Unknown
    in RCTView
    in j
    in RCTView
    in C
    in o
    in n
    in RNCSafeAreaView
    in Unknown
    in Unknown
    in RCTView
    in n
    in Unknown
    in Unknown
    in ForwardRef
    in Unknown
    in ForwardRef
    in n
    in n
    in RCTView
    in RCTView
    in h

Feature request: self-reporting features

From conversations with @ericlavigne on the MIT TR article:

  1. Due to the delay in testing, it might be better to implement self-reporting of previously visited locations (via pinpoints, not long/lat). The users would be able to populate at least some of the data not collected because they didn't install the app at the time, the app crashed on some days, etc.

  2. We could implement the possibility of checking for negative results/ absence of symptoms, when distributing warnings to contacts. Might be useful to trace secondary contacts and refine predictions.

BUG: iOS version not building from 'develop'

Currently you cannot build the iOS version of the app. The error reference the 'tripleblind' app, so it is likely that it has to do with renaming packages.

Can test against the first release off of the 'master' branch, which I believe did function.

Improve the saved point description

Currently the Export page shows some basic info about the saved data. It displays:
Points to be shared: 6134

We should expand this into something more friendly. Describe number of points, oldest date, and how recently it was updated.

Example:

Log has 22 days, 345 points, last updated 4 minutes ago.

Once that is possible, we can see it if will fit on the main screen, updated each time a new point is saved.

NOTE: Be aware that the stored datetime info is in UTC. Should be able to just subtract the first point's time from the current unixtimeUTC, then do division to figure out the number of days saved.

FEATURE: Add Face/Pin/whatever unlock on open

Use the operating system's current unlocking mechanism to open the app and show the data. The idea is to minimize snooping without the permission of the phone's owner. A good example of good implementation is the unlocking feature of Signal's Messaging app.

Implementations have to work on iOS and Android.

Google Import should expand logged points for duration

During the import of Google data the time is imported a single time/coordinate. However, the Google data has durations, so we should use that to expand points. This will be useful later in the intersections.

Basically, the Google data contains something like:

[ 
 {"placeVisit": {
      "location" : {
        "latitudeE7" : 423936728,
        "longitudeE7" : -710802770,
      },
      "duration" : {
        "startTimestampMs" : "1583085476383",
        "endTimestampMs" : "1583086992817"
      },
   }
}
...
]

The start time is: Sunday, March 1, 2020 5:57:56.383 PM
and the end time is: Sunday, March 1, 2020 6:23:12.817 PM

That is 26 minutes of the user at the same point, so import it in 5 minute intervals so it looks like:
[
{ startTimestampMs, latitudeE7, longitudeE7 },
{ startTimestampMs + 5 minutes, latitudeE7, longitudeE7 },
{ startTimestampMs + 10 minutes, latitudeE7, longitudeE7 },
{ startTimestampMs + 15 minutes, latitudeE7, longitudeE7 },
{ startTimestampMs + 20 minutes, latitudeE7, longitudeE7 },
{ startTimestampMs + 25 minutes, latitudeE7, longitudeE7 },
]

Don't stress too much about overlap between places, we can work with having time segments that are narrower than 5 minutes. But we will likely have issues intersecting in encrypted space with a timespan between points that is > 5 minutes.

Additionally, the transit points aren't being imported. It would be nice to import waypoint data.

Add info on what trails exist

Display very simple information on the status of trails. E.g. at the bottom of the main app:

    Trails:  12 days, last updated 2 minutes ago

Add webview

The "Info: N/A" needs to become a webview

Security scan: OWASP Mobile Top 10

We should scan the v1 release candidate to make sure we haven't introduced any obvious security problems. OWASP Mobile Top 10 is a good start.

Feature - Localize the app to support various languages

What is the feature -

Setup Internationalization framework to make the app multilingual.

What this feature can do -

  1. detect the user language
  2. load the translations
  3. optionally cache the translations
  4. etc

Why is it needed -

When the app will reach millions of people around the globe, they will prefer to have it in their local language.

The location settings alert box is not consistent

Right now for the phone versions which don't show 3 options for location (while using, always, never) but instead 2 options (always/yes, never), the location prompts up for them unnecessarily. We will have to dig deep into the response numbers by the geolocation api.

iOS build fails with yarn install

In my setup, I required to perform pod install as well in order to get npx react-native run-ios running successfully.

Xcode 11.3.1
yarn 1.2.4
Catalina 10.15.3

Build fail log -

info Found Xcode workspace "PrivateKit.xcworkspace"
info Building (using "xcodebuild -workspace PrivateKit.xcworkspace -configuration Debug -scheme PrivateKit -destination id=2B640F2E-4BE8-4FEC-9D36-4B3D0E9EF7AA")
............
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening PrivateKit.xcworkspace. Run CLI with --verbose flag for more details.
note: Using new build system
note: Planning build
note: Constructing build description
error: /Users/safepath/Workspace/private-kit/ios/Pods/Target Support Files/Pods-PrivateKit/Pods-PrivateKit.debug.xcconfig: unable to open file (in target "PrivateKit" in project "PrivateKit") (in target 'PrivateKit' from project 'PrivateKit')
error: /Users/safepath/Workspace/private-kit/ios/Pods/Target Support Files/Pods-PrivateKit/Pods-PrivateKit.debug.xcconfig: unable to open file (in target "PrivateKit" in project "PrivateKit") (in target 'PrivateKit' from project 'PrivateKit')
error: /Users/safepath/Workspace/private-kit/ios/Pods/Target Support Files/Pods-PrivateKit/Pods-PrivateKit.debug.xcconfig: unable to open file (in target "PrivateKit" in project "PrivateKit") (in target 'PrivateKit' from project 'PrivateKit')
error: /Users/safepath/Workspace/private-kit/ios/Pods/Target Support Files/Pods-PrivateKit/Pods-PrivateKit.debug.xcconfig: unable to open file (in target "PrivateKit" in project "PrivateKit") (in target 'PrivateKit' from project 'PrivateKit')
error: /Users/safepath/Workspace/private-kit/ios/Pods/Target Support Files/Pods-PrivateKitTests/Pods-PrivateKitTests.debug.xcconfig: unable to open file (in target "PrivateKitTests" in project "PrivateKit") (in target 'PrivateKitTests' from project 'PrivateKit')
error: /Users/safepath/Workspace/private-kit/ios/Pods/Target Support Files/Pods-PrivateKitTests/Pods-PrivateKitTests.debug.xcconfig: unable to open file (in target "PrivateKitTests" in project "PrivateKit") (in target 'PrivateKitTests' from project 'PrivateKit')
error: /Users/safepath/Workspace/private-kit/ios/Pods/Target Support Files/Pods-PrivateKitTests/Pods-PrivateKitTests.debug.xcconfig: unable to open file (in target "PrivateKitTests" in project "PrivateKit") (in target 'PrivateKitTests' from project 'PrivateKit')
error: /Users/safepath/Workspace/private-kit/ios/Pods/Target Support Files/Pods-PrivateKitTests/Pods-PrivateKitTests.debug.xcconfig: unable to open file (in target "PrivateKitTests" in project "PrivateKit") (in target 'PrivateKitTests' from project 'PrivateKit')


** BUILD FAILED **


No indicator during Location service failures

There are several reasons that location information might not be working properly:

  • GPS has been turned off
  • User disabled the permission under settings
  • Under iOS, app was shutdown in the background
  • Probably others

We need to validate access to GPS and notify/prompt the user when this happens.

Need to test on iPhone

So far this hasn't been run on iOS at all. Especially interested in the location service and if it runs in the background properly.

Android: App Crash

App Crashes when Denied permission for "location" access permission when started app for the first time.

Combine and curate location data

Have the location data store under single object, not as independent pieces.

Basic operation logic:

locs = []
if ("loc_data" exists)
   temp_locs = load("loc_data")

   # Curate
   for (i=0; i < len(temp_locs); i++)
      if (temp_locs[i] < 28 days old)
         locs += temp_locs[i]

...

# After every snapshot
save(locs)

Improve Google Location Data import experience

The Import functionality is great, but still tricky to use. It might take a few iterations to get it to what we want, but here are some thoughts:

Break the Import into three stages, kinda like an old-school Wizard.

  1. "Intro" page.
    Explain what this does and give instructions to log in and start the process w/Google.
    Q: Can we explore the DOM on the webview? It would be cool to watch for an indicator that the request for a takeout has happened, then move to the "Waiting" step described below.
  2. "Waiting on Google takeout" page
    If the user returns to Import page, show a message that we are still waiting on the takeout file.
    Include a "Start over" button to go back to Step 1 in case something fails.
  3. "Import Complete"
    After an import completes, the results of the import should be remembered and displayed. E.g.
    "28 day of data imported from Mar 1 - Mar 28".
    Also have an "Import again" button that goes back to step 1.

During Step 2 the user should be be able to leave the app or go back to the main page. We should have a background task look for the takeout file when one is pending, so you don't have to go back to Import. The app should show a notification when the takeout file is found and process completes.

Discussion is welcome. I expect the implementer will find challenges and opportunities to improve this sequence. For instance, there might be a step 2.5 that helps with the download of the Takeout file.

Import Locations from Google on iOS: Browser opens the Zip file in the Webview.

On Android, the app saves a file in the Downloads folder.

On iOS, the WebView shows the zipped binary file in the app itself.

We need to figure out a way to either download it to a file and then open with the SearchAndImport function or keep it in memory (500MB in memory?) and pass it to the SearchAndImport function.

Import Module: Load waypoints and path points from Google's Take out file

Google has several semantic ways to log lat, long. The current implementation only imports placeVisit.locations.

Use the following JSon for reference.

{
  "timelineObjects" : [ {
    "activitySegment" : {
      "startLocation" : {
        "latitudeE7" : 423712157,
        "longitudeE7" : -710801235
      },
      "endLocation" : {
        "latitudeE7" : 423889867,
        "longitudeE7" : -710885437
      },
      "duration" : {
        "startTimestampMs" : "1580515266408",
        "endTimestampMs" : "1580515754966"
      },
      "distance" : 2353,
      "activityType" : "IN_PASSENGER_VEHICLE",
      "confidence" : "HIGH",
      "activities" : [ {
        "activityType" : "IN_PASSENGER_VEHICLE",
        "probability" : 81.76090121269226
      }, {
        "activityType" : "WALKING",
        "probability" : 8.278883248567581
      }, {
        "activityType" : "STILL",
        "probability" : 8.125560730695724
      }, {
        "activityType" : "CYCLING",
        "probability" : 1.0427268221974373
      }, {
        "activityType" : "IN_BUS",
        "probability" : 0.3525716718286276
      }, {
        "activityType" : "MOTORCYCLING",
        "probability" : 0.2875321079045534
      }, {
        "activityType" : "IN_FERRY",
        "probability" : 0.0427420309279114
      }, {
        "activityType" : "RUNNING",
        "probability" : 0.03588703693822026
      }, {
        "activityType" : "IN_TRAM",
        "probability" : 0.028896320145577192
      }, {
        "activityType" : "IN_TRAIN",
        "probability" : 0.024446286261081696
      }, {
        "activityType" : "FLYING",
        "probability" : 0.008416806667810306
      }, {
        "activityType" : "SKIING",
        "probability" : 0.005187333226785995
      }, {
        "activityType" : "SAILING",
        "probability" : 0.00476947971037589
      }, {
        "activityType" : "IN_SUBWAY",
        "probability" : 0.0013954329915577546
      }, {
        "activityType" : "IN_VEHICLE",
        "probability" : 7.47239539578004E-5
      } ],
      "waypointPath" : {
        "waypoints" : [ {
          "latE7" : 423710594,
          "lngE7" : -710801620
        }, {
          "latE7" : 423863258,
          "lngE7" : -710905609
        }, {
          "latE7" : 423890876,
          "lngE7" : -710887298
        } ]
      }
    }
  }, {
    "placeVisit" : {
      "location" : {
        "latitudeE7" : 423890312,
        "longitudeE7" : -710873334,
        "placeId" : "ChIJ1WFe6dBw44kRJUBchSYYOwQ",
        "address" : "192 Broadway\nSomerville, MA 02145\nUSA",
        "name" : "Pastelaria Vitoria Broadway",
        "sourceInfo" : {
          "deviceTag" : 584934457
        },
        "locationConfidence" : 97.59531
      },
      "duration" : {
        "startTimestampMs" : "1580515754966",
        "endTimestampMs" : "1580517709770"
      },
      "placeConfidence" : "HIGH_CONFIDENCE",
      "centerLatE7" : 423890592,
      "centerLngE7" : -710873954,
      "visitConfidence" : 94,
      "otherCandidateLocations" : [ {
        "latitudeE7" : 423897552,
        "longitudeE7" : -710871984,
        "placeId" : "ChIJw2tLwdBw44kRFba_DA_Hx1g",
        "locationConfidence" : 0.75358087
      }, {
        "latitudeE7" : 423890312,
        "longitudeE7" : -710873334,
        "placeId" : "ChIJSVnC7tBw44kR1oS-EJkqp0Y",
        "locationConfidence" : 0.42350954
      }, {
        "latitudeE7" : 423898700,
        "longitudeE7" : -710876090,
        "placeId" : "ChIJP5glxdBw44kRc1lm9vWMjJQ",
        "semanticType" : "TYPE_SEARCHED_ADDRESS",
        "locationConfidence" : 0.2731733
      }, {
        "latitudeE7" : 423906046,
        "longitudeE7" : -710868862,
        "placeId" : "ChIJaTaVStdw44kRTKBU4LdaEGw",
        "locationConfidence" : 0.24667592
      } ],
      "editConfirmationStatus" : "NOT_CONFIRMED"
    }
  }, {
    "activitySegment" : {
      "startLocation" : {
        "latitudeE7" : 423888999,
        "longitudeE7" : -710879550
      },
      "endLocation" : {
        "latitudeE7" : 423916225,
        "longitudeE7" : -710855273
      },
      "duration" : {
        "startTimestampMs" : "1580517709770",
        "endTimestampMs" : "1580518069792"
      },
      "distance" : 362,
      "activityType" : "IN_PASSENGER_VEHICLE",
      "confidence" : "MEDIUM",
      "activities" : [ {
        "activityType" : "IN_PASSENGER_VEHICLE",
        "probability" : 74.45971369743347
      }, {
        "activityType" : "STILL",
        "probability" : 15.32638967037201
      }, {
        "activityType" : "WALKING",
        "probability" : 8.971372991800308
      }, {
        "activityType" : "CYCLING",
        "probability" : 0.9968267753720284
      }, {
        "activityType" : "RUNNING",
        "probability" : 0.09207993862219155
      }, {
        "activityType" : "MOTORCYCLING",
        "probability" : 0.06667065899819136
      }, {
        "activityType" : "IN_FERRY",
        "probability" : 0.030013773357495666
      }, {
        "activityType" : "IN_BUS",
        "probability" : 0.027368837618269026
      }, {
        "activityType" : "SKIING",
        "probability" : 0.016939605120569468
      }, {
        "activityType" : "IN_TRAM",
        "probability" : 0.004777643334819004
      }, {
        "activityType" : "FLYING",
        "probability" : 0.003842801379505545
      }, {
        "activityType" : "SAILING",
        "probability" : 0.0028253632990526967
      }, {
        "activityType" : "IN_TRAIN",
        "probability" : 0.001140081076300703
      }, {
        "activityType" : "IN_SUBWAY",
        "probability" : 3.529360412812821E-5
      }, {
        "activityType" : "IN_VEHICLE",
        "probability" : 8.94935823225751E-6
      } ],
      "waypointPath" : {
        "waypoints" : [ {
          "latE7" : 423890037,
          "lngE7" : -710881652
        }, {
          "latE7" : 423910942,
          "lngE7" : -710867080
        }, {
          "latE7" : 423918151,
          "lngE7" : -710858764
        } ]
      }
    }
  }
]} 

FEATURE: Import Google Location data

It would be valuable to have a button that will reach out one time to import the user's Location history from Gogole. This would give them an instant 28 day cache moments after installing the application.

FEATURE: Export trails

Look into using a QR code to either hold the location trail or hold the key to decrypt a version uploaded to a public drop URL (any anonymous drop).

BUG: App beeps regularly

When installed on a real phone, the app beeps every time it captures a GPS coordinate. Very irritating and a sure way to get uninstalled!

Audit licenses

We need to audit the licenses of all plugins in. Note any that require a visible attribution. If we have any, we will need to create an About page that shows that.

Refine Share

The basic Share functionality works, but it could use some refinement. Specfically two things:

  • Improve the filename. Currently it is ".null". Change it to be "PrivateKit_.json"
  • Add a message body. Try:
    Here is my location log from Private Kit.
  • If titles are supported, make it: "Shared PrivateKit_.json"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.