如何使用Facebook iOS SDK管理生产和开发凭证 [英] How to manage production and development credentials using Facebook iOS SDK

查看:222
本文介绍了如何使用Facebook iOS SDK管理生产和开发凭证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

症状



我的应用程序正在使用Facebook让用户登录。它可以在从XCode调试和通过AdHoc部署进行测试时正常工作,以便我们拥有外部测试人员提交我们的应用程序进行审查,但似乎Facebook在OAuth流程期间抱怨应用程序未设置:此应用程序的开发人员尚未正确设置此应用程序以进行Facebook登录。



< h1>假设

FacebookDisplayName FacebookAppId 存在于XCode中我的目标的 info 部分中的自定义iOS目标属性与Facebook应用开发版本相匹配。不知何故,SDK必须检测到在审核期间应用程序不再处于开发状态并且发生错误。



问题



如何在该目标中定义一些自定义iOS目标属性,其中包含不同的版本 debug values?

解决方案

您可以在Target的设置中添加用户定义的设置,其中包含不同的值每个方案(Debug,Release,Ad-Hoc,AppStore等)并使用info.plist文件中的用户定义变量(或称为自定义iOS目标属性)。



以下是我如何为应用程序的包标识符执行此操作的示例。我想要Debug和AdHoc版本的单独的bundle标识符和服务器URL,因此可以在同一设备上安装和测试它们:


  1. 在目标设置中将所需数据添加为用户定义的设置。


  2. 为不同的方案设置变量的不同值。 (确保检查目标设置是否反映了更改,而不仅仅是项目设置。):


编辑:添加用户定义设置的详细图片:






  1. 在上图中,BUNDLE_ID_PREFIX和BUNDLE_ID_SUFFIX对每个方案都有不同的值。 / p>


  2. 在info.plist中使用此变量而不是默认值:


默认情况下,您将使用调试方案来运行来自xcode的应用程序。如果您使用发布方案归档应用程序以进行上传,它将自动从目标设置中选择正确的值。


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?

解决方案

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.

这篇关于如何使用Facebook iOS SDK管理生产和开发凭证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆