问题
Symptoms
My app is using Facebook to let users log in. It works fine while debugging from XCode and testing through AdHoc deployment, in order to have external testers we submitted our app for review but it seems that Facebook is complaining during the OAuth Process "App Not Setup: The developers of this app have not setup this app properly for Facebook Login".
Hypothesis
The FacebookDisplayName
and FacebookAppId
present in the Custom iOS target properties
in the info
section of my target in XCode are matching the Facebook app development version. Somehow, the SDK must detect that during the review the app is not anymore in development and an error occures.
Question
How do I define in that target some Custom iOS target properties
with different release
and debug
values?
回答1:
You can add a user defined setting in Target's settings with different values for each scheme (Debug, Release, Ad-Hoc, AppStore etc) and use the user defined variable in info.plist file (or as you call it Custom iOS target properties).
Here is an example of how i did it for an app's bundle identifier. I wanted separate bundle identifier and server URLs for the Debug and AdHoc versions so both could be installed and tested on same device:
Add required data as a user defined settings in Target Settings.
Set different values for the variable for different scheme. (Make sure to check the target settings reflects the changes and not just project settings.):
EDIT: Detailed image for adding user defined settings:
In above image, BUNDLE_ID_PREFIX and BUNDLE_ID_SUFFIX have different values for each scheme.
Use this variable instead of default values in info.plist:
You will by default use debug scheme for running the app from xcode. If you use release scheme for archiving the app for upload, it will automatically pick up the correct value from target settings.
来源:https://stackoverflow.com/questions/29348505/how-to-manage-production-and-development-credentials-using-facebook-ios-sdk