Set environment variables in your codemagic.yaml:
SONAR_TOKEN: Encrypted(...)
SONAR_PROJECT_KEY: Encrypted(...)
SONAR_ORG_KEY: Encrypted(...)
Refer to the codemagic.yaml in the root of this project to see how to configure sonarcloud integration for iOS.
https://sonarcloud.io/dashboard?id=codemagic-ci-cd_sonarcloud-sample-project