I need to use the same Facebook App ID for my staging
and production
builds. I've defined the URL schemes suffix in my app .plist
file and configured the dashboard with the required Bundle Id and URL schemes ,following exactly as sharing an app ID across Apps doc.
Dashboard's URL scheme suffix:
App-Info.plist:
The thing is , I am able to login with Facebook on my staging
build properly but when I try to login on production
build, it crashes and breaks at the following:
I've tried some of the almost similar solutions, but none of it is working for me. Can someone point me in the right direction?
Got it solved. As it turns out, I can only define one FB URL Scheme per scheme. I also forgot to define FacebookURLSchemeSuffix
. So, what I did is, I use user-defined setting to alternate between staging
and production
build. Here's how I did it.
Targets > Build Setttings
and add user-defined setting
.Then, I set my user-defined values(FB_SCHEME
) to staging
for staging
build and vice versa.
App-info.plist
file. I set my FacebookURLSchemeSuffix
and URL scheme
to the following:
Now, whenever I switch between schemes, it will set the value of ${FB_SCHEME}
to production
or staging
. That's it.