Serve PHP / MySQL with Apache / Nginx / FastCGI on Swift (iOS)

At work, we have a corporate store, which means we can bypass most of the basic rules of the Apple App Store. We have a custom data management system written in CodeIgniter with MySQL as a database engine serving the Apache infrastructure.

We are currently getting more and more questions to run the system offline on iPad. I tried using LocalStorage etc. but it is not enough and stable enough (WebStorage / WebSQL glitchy) and the storage size allowed is too small to insert all offline buffered data.

I know this is very ugly, but as we mostly know, customers always find the weirdest ways to request features, and our sales team always handles this without contacting us: P.

I've been browsing Google / DuckDuckGo and CocoaPods for a while, but I can't find anything that combines PHP running in Swift (Objective-C would be fine too), serving it on Apache / Nginx / FastCGI with MySQL (I could replace that with SQLite3).

I was wondering if anyone has any experience with backend server in Swift / Objective-C this way.

+3


source to share


2 answers


If you want to keep your current technology stack, you can use something like Realm . It is a replacement for Core Data, and it allows you to easily create objects from JSON REST APIs and store them in a local database. But you still have to write some specific application code to synchronize the data on the mobile device with the server, and you must have RESTful services that generate JSON on the server.



If you're ready to switch your persistence stack, you can use Couchbase Mobile , which lets you transparently sync your data to your device using the data in your database, back and forth. But then you have to use Couchbase on the server.

0


source


If you want server side Objective-C take a look at https://github.com/depinette/backtoweb

I haven't updated this framework in a while, but it worked for me.



It is based on fastcgi and can be used with an OSX-integrated Apache server.

Let's say you could use swift instead of Objective-C.

0


source







All Articles