ito-org / ito-app

A privacy-first contact tracing app
https://ito-app.org
GNU General Public License v3.0
46 stars 17 forks source link

Trigger notification upon at-risk for infection status #101

Open haveyaseen opened 4 years ago

haveyaseen commented 4 years ago

The user should get a native notification if they are deemed to be infected.

To do that, move this code from HomeBluetooth screen to App.tsx or somewhere where it makes more sense.

  useEffect(() => {
    function refresh(): void {
      if (NativeModules.ItoBluetooth.isPossiblyInfected() && !hasSeenIDMatch) {
        setIDMatchShow(true);
      }
    }
    const interval = setInterval(refresh, 2500);
    return (): void => clearInterval(interval);
  }, [navigation, hasSeenIDMatch]);
teamdraftbox commented 4 years ago

@haveyaseen created pr for the issue please review it https://github.com/ito-org/ito-app/pull/337

pompeiifreckles commented 4 years ago

I would like to solve this issue. Can I be assigned this issue.

pompeiifreckles commented 4 years ago

Can I get a little more info about this. As I can see, there is already code for native notification in one of the screen. Do you want to get this system throughout the app by placing this code segment in a upper levels in the tree or do you want this feature available in every screen by making this as a component and importing it in every screen.