I’m developing an iOS app similar to food delivery services. I want to use a Google Sheet as a private database to store product information. I’ve tried Firebase, iOS Quickstart, and GoogleDocsBackend, but nothing worked even though I set up the pods correctly.
Here’s the structure I’m using for my products:
struct Item {
let id: String
let category: String
let name: String
let cost: Double
let rating: Double
let reviewCount: Int
let details: String
let groupId: String
let imageUrl: String
init(id: String, category: String, name: String, cost: Double, rating: Double, reviewCount: Int, details: String, groupId: String, imageUrl: String) {
self.id = id
self.category = category
self.name = name
self.cost = cost
self.rating = rating
self.reviewCount = reviewCount
self.details = details
self.groupId = groupId
self.imageUrl = imageUrl
}
}
I also need to add Google Sign-In for users to access the main screen with all the items. Any ideas on how to connect Google Sheets to my app? I’m really stuck and can’t find much help online.
hey alex, i’ve been there. google sheets can be tricky. have u considered using realm? it’s pretty easy to set up and works great for local storage. for google sign-in, try googles official sdk. it’s not too bad once u get the hang of it. good luck with ur app!
Using Google Sheets as a database for an iOS app isn’t ideal for scalability and performance reasons. Instead, consider using a more robust solution like Firebase Realtime Database or Firestore. These services offer better security, real-time updates, and offline capabilities.
For Google Sign-In, you can implement it separately using Google’s official SDK. Once authenticated, use the user’s token to access your chosen database solution.
If you’re set on using Google Sheets, look into Google Sheets API v4. You’ll need to create a service account, enable the API in your Google Cloud Console, and use a library like SwiftyJSON to parse the data.
Remember, while Google Sheets might work for prototyping, it’s not recommended for production apps due to rate limits and potential security issues.
hey alex! have u thought about using airtable? its kinda like google sheets but way cooler for app stuff. plus, they have an API that’s pretty easy to use. maybe give that a shot?
also, for google sign-in, the official SDK is ur best bet. what kinda food delivery are u doing? sounds interesting!