See Facebook documentation
- Create Configurations for each environment you have
- Create Schemes for each environment and assign Configurations accordingly
- In
Project SettingsunderPreprocessor MacrosdefineENVIRONMENT=environment1,ENVIRONMENT=productionetc for each scheme - Add Shell Script above to the Build steps
- Make sure you enabled URL scheme suffix
Essentially it looks at the first record under the URL handlers and if it matches expected, script exits
Otherwise it inserts another record to handle fb{app_id}{env} url