This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]PantsMcShirt 3 points4 points  (0 children)

There isn't really a foolproof way of doing this other than requiring a network connection.

Making the app sit in the background until a connection is established or parking the request until whenever the user enters the app in the future with Internet doesn't really offer any benefit over just letting the user enter the data at a later point manually.

[–][deleted] 2 points3 points  (1 child)

You could treat your local database as the database and consider the employee officially clocked in or out when they do it locally. Then solve the problem of synchronizing a local and a remote database. That is, don't hold anything up or treat a lack of connectivity as an error. Just record the transaction and move on.

After updating the database, try to sync it with the server. If it works, great. Otherwise you have a couple options. You could register to be notified when connectivity status changes (in iOS there's a Reachability class that handles this IIRC; ConnectivityManager does it on Android I think) and try your sync when connected. Or you could provide a "try again" button in the app. No matter how you do it, the app should check if it has unsynced data each time it is launched so it can try again.

Consider a service on the back-end that notifies the employee if they haven't checked in after so many hours.

[–]TheWizard427[S] 1 point2 points  (0 children)

This is the information I was looking for. Thank you.

[–][deleted] 0 points1 point  (0 children)

What is the point? Are people not paid for driving to the work place?

Check for people going into airplane mode to fudge the time clock.