Reputation: 75
My question revolves around how to transition the information in the GoogleService-Info.plist file to Production (i.e. deployed on the iOS App Store)?
My predicament is pretty simple: I am developing a native iOS app in Swift. I am using Firebase ML Kit (Google Cloud Vision API). When I first set up my project in Firebase, I was prompted to download the GoogleService-Info.plist file, which I did. It is on the Desktop on my local computer, and all my local development works fine.
But, now I am ready to deploy this app to the App Store. Obviously, the App Store app is not going to fetch the credentials from my local Desktop. I am confused on how to transition my credentials to Production. I have read all of the Google Cloud docs (Securing API Keys, Service Accounts, etc.) but I have not found a simple, well-explained solution on how to approach this. If you are able to explain this to me as opposed to link to one of these resources that would be incredibly helpful. Thank you very much.
Upvotes: 3
Views: 2000
Reputation: 1727
I had a similar situation where I needed to use separate Firebase projects for dev
& prod
environments, and like you, I didn’t want to expose sensitive credentials on GitHub.
Here’s how I solved it using iOS .xcconfig
files:
GoogleService-Info.plist
into a Config_dev.xcconfig
file..xcconfig
file in the project settings..xcconfig
file in the Info.plist
file.Info.plist
.FirebaseApp.configure(with: options)
.This way, I was able to keep my credentials secure and still manage different environments easily.
Here you can find detailed blog
Upvotes: 0
Reputation: 477
So, already you have a iOS project configured for GCV API. If the FCM development account and production account are same, the GoogleInfoServiceInfo.plist going to be same. So no worries. You can move to production with same file.
If production account is different, in the new production FCM account you have to configure the iOS app in the FCM API console for accessing the GCV API, download the plist file and replace it with the old one in same path. It should work perfectly.
Make sure to backup your old plist file before replacing with new one.
Upvotes: 1