connect iOS app to cloud database - ios

I am creating an iOS app using Swift and I need to connect to an online SQL database to fetch and save data.
The app runs on user's phone locally but fetches only numbers from the cloud database.
Since I am new to iOS development I am looking for some good tutorials or guidance in this matter.

Your question isn't so much about databases -- since the database is hosted in the cloud. Instead you should focus your efforts on how to make network requests, and parse data like JSON using Swift.
http://www.raywenderlich.com/82706/working-with-json-in-swift-tutorial

Related

Difference between event child_added of Realtime Database Firebase vs Firebase Cloud function

I having a case where I need to receive notification whenever Realtime Database Firebase have new data. When investigate, I found out there are 2 way to do this in client side (mobile app using React Native):
Using Realtime Database child_added event
Using Cloud Functions event onWrite()
Can someone please tell me what is the difference between 2 way and pros and cons of each way?. The document is not helpful for me about this.
Note:
Backend Server written in Java framework Spring boot response function push new data to Realtime Database Firebase.
Client side need to receive notification when new data added to Realtime Database Firebase (currently only mobile app written in React Native but I also need to do it for web in the future)
Paraphrasing Frank Van Puffelen's comment as an answer:
Firestore and Realtime databases are two completely separate databases. Though firestore and Realtime database both are part of Firebase. If you want to trigger a cloud function from Real Time database, please follow this documentation. If you want to trigger cloud function from Firestore, please check this documentation.

Is it possible to run queries on the offline local version of Firebase on mobile device?

I'm considering to use Firebase as the server database for the mobile app (iOS). The point is user should be able to:
Work offline with data
Run some queries on data even if it's offline
So I believe the first problem is not a problem anymore as for Firebase implemented the local offline version but what about the second one?
The scenario is: user downloads data when it's online and keep working with loaded data even if it's offline. What does it mean - the app allows user doing search by different criteria, so I have to implement some type of queries on the mobile. I can't figure out though if it's possible with Firebase.

AWS iOS SDK: Is it possible long poll or be notified when changes are made to a DynamoDB table?

I am working on an app that requires near realtime updates for a certain table. Is there built in functionality with the current AWS iOS SDK to be notified when changes are made to a DynamoDB table. I've done a little reading and know about the DynamoDB Streams, but I didn't see anything about them when looking through the iOS API reference.
If the functionality doesn't exist in the iOS SDK yet, would it be possible to get the Dynamo shard information into my app from another source (i.e. REST API call)?

iOS - sending data between two apps on two devices

Trying to figure out the most efficient way of sending data between one app (app1) on a device (dev1), to another different app (app2) on another device (dev2). Initially I thought this would be done through some type of web service, however, I was hoping there is something in the iOS SDK. If there is... how exactly can it be done (maybe by using URLS or Bonjour)? I can't find a clear answer when searching the web.
App1 on dev1 generates some sort of data -> app2 on dev2 receives and uses this data for its own purposes.
...The apps are also meant to be used in the same general area, however I worry that bluetooth range might be a problem
If both application is developed by you, then for sharing data I'll suggest the following techniques :
Bonjour
iCloud

Best practice to sync webservice with offline storage on iOS

I have been working on a few iOS applications that talk to a REST API on the web server and than sync some data down for offline usage. The app then stores data locally if network connection is not available and than syncs with backend whenever the Internet connection is available.
I am wondering if there is a nice pattern or set of rules or library that can be used. I would rather not code this again and again. I know the business logic / sync logic would be different for each app but the rest of the work (ie. storing it locally, calling REST API) can be abstracted out.
Any ideas?
I use the RestKit framework in my app for the exact scenario you describe. The downloaded data are stored in a Core Data store for offline usage.

Resources