Skip to content

Commit

Permalink
fix: bug writing firebase.json
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley committed Jan 12, 2023
1 parent 931c868 commit 2f4f3dc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
12 changes: 6 additions & 6 deletions packages/flutterfire_cli/lib/src/common/utils.dart
Expand Up @@ -401,12 +401,12 @@ Future<void> writeFirebaseJsonFile(
if (file.existsSync()) return;

final map = {
'flutter': {
'platforms': {
'ios': {
'schemes': <String, Object>{},
'targets': <String, Object>{},
'default': <String, Object>{}
kFlutter: {
kPlatforms: {
kIos: {
kSchemes: <String, Object>{},
kTargets: <String, Object>{},
kDefaultConfig: <String, Object>{}
}
}
}
Expand Down
Expand Up @@ -131,7 +131,7 @@ end
String appId,
String projectId,
bool debugSymbolScript,
String schemeOrTarget,
String schemeOrTargetName,
String pathToServiceFile,
ProjectConfiguration projectConfiguration,
) async {
Expand All @@ -149,12 +149,17 @@ end
final iosConfig = platform?[kIos] as Map?;

final configurationMaps = iosConfig?[configuration] as Map?;
final configurationMap = configurationMaps?[schemeOrTarget] as Map?;

configurationMap?[kProjectId] = projectId;
configurationMap?[kAppId] = appId;
configurationMap?[kUploadDebugSymbols] = debugSymbolScript;
configurationMap?[kServiceFileOutput] = pathToServiceFile;
if (configurationMaps?[schemeOrTargetName] == null) {
// ignore: implicit_dynamic_map_literal
configurationMaps?[schemeOrTargetName] = {};
}

final configurationMap = configurationMaps?[schemeOrTargetName] as Map;
configurationMap[kProjectId] = projectId;
configurationMap[kAppId] = appId;
configurationMap[kUploadDebugSymbols] = debugSymbolScript;
configurationMap[kServiceFileOutput] = pathToServiceFile;

final mapJson = json.encode(map);

Expand Down

0 comments on commit 2f4f3dc

Please sign in to comment.