I’m working on a simple iOS app that logs my dog’s activities in a table view. Each event is just a time stamp and a couple of simple value properties (strings and integers).
Currently, my app stores this in a SQLite database.
I’d like for my wife and I to both use the app. This would require being able to share the log database between two instances of the app on different devices.
What would be the best approach to do this?
I was thinking that maybe putting the SQLite file in iCloud. Would that work? Would another device be able to open the file if I figured out the permissions correctly?
Ideally I’d like to avoid having to setup a server just to host a simple text file!
It’s not a simple text file. Putting an sqlite database on shared storage is highly discouraged. Once you get more than one device accessing it you need to use another solution.
Since this is mobile, I’m guessing it needs to be accessible outside the local network, so it will need to be at least a web app serving a REST api. You could also move the data entry to the web app and not need REST, but it’s no longer an ios app. It’s just a web page.
I use AirTable for an on-line phone directory app. As long as you have less than 1000 records the account is free. Their API documentation is excellent.
As we have moved onto hosted solutions (conscious that @GarryPettet ideally didn’t want to do that ideally), a contender that I feel I need to mention is pocketbase.
Download a pre-built binary and go with that. From the intro page:
PocketBase is an open source backend consisting of embedded database (SQLite) with realtime subscriptions, built-in auth management, convenient dashboard UI and simple REST-ish API.
It is it’s own web server based on Go and can handle a lot of connections it seems.