-
Using Firebase Functions with an external API (Walmart)
-
Consuming Firebase Realtime Database/Functions in an iOS app using FirebaseUI
-
A gmail account
-
Billing enabled in the GCP Console (https://console.developers.google.com/) You might be eligible for a free trial with a $300, 12-month credit
-
A Walmart Open API key Register at https://developer.walmartlabs.com/
-
Node.js, npm and Firebase CLI installed npm install -g firebase-tools
-
Using the Firebase Console (https://console.firebase.google.com), create a new project
-
Upgrade the pricing plan to Blaze (Pay as you go)
-
Log into the Firebase CLI firebase login
-
In the terminal, navigate to the root of this repository
-
Initialize the Firebase Functions firebase init functions When prompted, select the project created in step #1. Do not overwrite existing files. Say "Y" to "Do you want to install dependencies"
-
cd functions
-
Edit the walmartAPI.js file and update the WALMART_API_KEY constant with your key
-
Deploy the functions firebase deploy --only functions
-
In the Firebase Console, use the Database Rules to make the database public (Caution - this is only good for demo purposes, do not leave a production database public) { "rules": { ".read": true, ".write": true } }
-
In the Firebase Console, go through the "Add Firebase to your iOS App" wizard
-
Enter "com.github.davidair.FunctionsDemo" as the iOS Bundle ID
-
Download GoogleService-Info.plist
-
In the FunctionsDemo directory, run "pod install"
-
Open FunctionsDemo.xcworkspace
-
Drag the GoogleService-Info.plist downloaded in step 12 into the project
You should be able to run the demo in the simulator