Skip to content

Instantly share code, notes, and snippets.

@dongmai
Created January 5, 2022 10:42
Show Gist options
  • Save dongmai/1affc92f467d4e612efe96722707367a to your computer and use it in GitHub Desktop.
Save dongmai/1affc92f467d4e612efe96722707367a to your computer and use it in GitHub Desktop.
Android update config with fastlane
# Update social info
socialInfo = config["socials"]
fbId = ""
gmapId = ""
if socialInfo.kind_of?(Array)
socialInfo.each do |item|
if item["type"] == "google"
gmapId = item["gmap_id"]
end
if item["type"] == "facebook"
fbId = item["id"]
end
end
end
configPath = "#{placeHolderPath}/res/values/config_string.xml"
unless fbId.empty?
updateXmlConfig(filePath, { "facebook_app_id" => fbId, "fb_login_protocol_scheme " => "fb#{fbId}" })
end
unless gmapId.empty?
updateXmlConfig(filePath, { "google_maps_api_key" => gmapId })
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment