How to manage production and development credentials using Facebook iOS SDK

此生再无相见时 提交于 2019-12-18 09:36:25

问题


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:

  1. Add required data as a user defined settings in Target Settings.

  2. 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:

  1. In above image, BUNDLE_ID_PREFIX and BUNDLE_ID_SUFFIX have different values for each scheme.

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!