Expo app.config.js googleServicesFile for different build variants

Viewed 428

I want to be able to differentiate between build variants on my Expo App.

At the moment I have my expo config in my app.config.js like so


import Constants from 'expo-constants';

let AndroidGoogleServicesFile = './google-services-dev.json';

if (Constants.manifest.releaseChannel === 'staging') {
  AndroidGoogleServicesFile = './google-services-staging.json';
}
if (Constants.manifest.releaseChannel === 'release') {
  AndroidGoogleServicesFile = './google-services.json';
}
...
{
...
android: {
  adaptiveIcon: {
    foregroundImage: './assets/images/adaptive-icon.png',
    backgroundColor: '#FFFFFF',
  },
  package: 'com.companyname.App',
  googleServicesFile: AndroidGoogleServicesFile,
},
...

AS you can see i want to be able to configure my googleServicesFile based on releaseChannel or build variant but this doesn't seem possible at the moment? I am using EAS to build aswell and i'm not sure i can configure it in my eas.json either...

0 Answers
Related