I'm sold on the concept. I especially like the fact that you're using ARC on iOS; my intuition is that this would interact better with the platform and native development tools than something like Xamarin which requires GC.
Do you have a way of doing local storage, i.e. to the file system or a database, in cross-platform code? Or does that have to be platform-specific? How about making HTTP/HTTPS requests?
We dependency injection network and database abstractions. For network, because Google loves protobufs, we have a network channel abstraction between client and server, or between processes, that can send/receive protos. For storage, we have an IndexDb like abstraction.
We hand-rolled our dependency injection stuff, but if we did it again, we'd just use Dagger 2 which works on all platforms.
We are second guessing our decision to go with an IndexDB abstraction. The code to use this is not very maintainable, and so we're looking at moving to a SQL-lite-ish kind of abstraction for storage. It might still be IndexDB underneath on some platforms, but operations will be higher level.
You can't get away from some platform native APIs. In general, abstract them, or copy the ones that PhoneGap already designed, and dependency inject the real implementations (instead of the PhoneGap approach which is to serialize RPC calls through URLs from a JS VM)
You can imagine a class like this:
public class InboxImpl {
@Inject
public InboxImpl(SQLStorage sql) { ... }
public List<Messages> findMessagesByAuthor(String author) {
return sql.from("messages").select("body","author").where("author").contains(author).asList();
}
}
Do you have a way of doing local storage, i.e. to the file system or a database, in cross-platform code? Or does that have to be platform-specific? How about making HTTP/HTTPS requests?