Skip to content

Instantly share code, notes, and snippets.

@dongmai
Created January 5, 2022 10:41
Show Gist options
  • Save dongmai/2183e5e2a7f4b34f8eb7febb146abe8d to your computer and use it in GitHub Desktop.
Save dongmai/2183e5e2a7f4b34f8eb7febb146abe8d to your computer and use it in GitHub Desktop.
iOS update plist file with fastlane
# Update social info
socialInfo = config["socials"]
fbId = ""
schemes = []
if socialInfo.kind_of?(Array)
socialInfo.each do |item|
if item["type"] == "google"
schemes << {
"role" => "Editor",
"scheme" => item["id"],
}
end
if item["type"] == "facebook"
fbId = item["id"]
schemes << {
"scheme" => "fb#{fbId}",
}
end
end
end
if schemes.length > 0
# Update URL Schemes
addSchemeUrls(plistPath, schemes)
end
# Update Facebook ID
unless fbId.empty?
updatePlist(plistPath, { "FacebookAppID" => fbId })
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment