in theory, relatively simple:
user updates local database
user updates main database with a constraint, eg, WHERE ... AND app_id = 'this_unique_app_id'. (assuming you can guarantee a unique app_id).
in practice, you have no guarantee user will be online when local db is updated, so you have to be prepared to copy local updates to a local file (as sql statements). the next time user is online, she updates the main db from the local file BEFORE any new updates. (or keeps adding to the local file until she gets online.)
and, for the conspiracy-minded, you have no guarantee that some ill-tempered state actor doesn't send an app_id belonging to someone else and wipes out
that user's db or worse. having multiple copies of data is always risky. if user gets a new device or resets device or reinstalls your app, how does she recover her data?