iOS Facebook SDK - 远程定义FacebookAppID [英] iOS Facebook SDK - define FacebookAppID remotely

查看:207
本文介绍了iOS Facebook SDK - 远程定义FacebookAppID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用iOS SDK SDK 3.0,需要在应用程序的info.plist上定义FacebookAppID和相关的URL Scheme。我想远程定义(请求到我自己的服务器的应用程序ID)。所以2个不同的问题:

Working with iOS Facebook SDK 3.0, it needs to define FacebookAppID and the related URL Scheme with it on the info.plist of the app. I want to define these remotely (request to my own server for app id). So 2 different questions:


  1. 我可以在运行时修改应用程序的info.plist吗?或者我可以在另一个plist中定义FacebookApID和URL Scheme
    ,我可以改变plist甚至创建一个新的自定义plist文件?

  2. 是否有另一种方法来定义URL Scheme应用程序ID,除了使用info.plist for
    Facebook SDK 3.0?


推荐答案

1.1否您不能在运行时更改Info.plist文件。

1.1 No you cannot alter the Info.plist file at runtime.

1.2否你不能加载另一个plist文件来覆盖Info.plist中的设置。

1.2 No you cannot load another plist file to override settings in Info.plist.

2.1是的,你可以通过调用 [FBSettings setDefaultAppID:@您的Facebook应用程序ID]; 查看 FBSettings.h

2.1 Yes, you can define FacebookApID without altering Info.plist file, by calling [FBSettings setDefaultAppID:@"Your Facebook App ID"]; See the source code of FBSettings.h in Facebook iOS SDK.

2.2否,URL Scheme必须在Info.plist中定义,以便iOS可以识别它。我相信,在安装应用程序时,iOS阅读URL方案,并将其缓存到系统的其他位置。即使您可以更改Info.plist,系统也不会收到您的新URL方案。但不用担心,在不使用URL方案的情况下,有一个Facebook身份验证的解决方法!我们可以强制Facebook iOS SDK使用UIWebView进行登录,请参阅此stackoverflow问题

2.2 No, URL Scheme must be defined in Info.plist so iOS can recognize it. I believe that the URL Scheme is read by iOS when installing your app, and it is cached elsewhere in system. Even if you can alter your Info.plist, the system won't pick up your new URL Scheme. But don't worry, there's a workaround for Facebook authentication without using URL schemes! We can force the Facebook iOS SDK to use UIWebView for login, see this stackoverflow question.

这篇关于iOS Facebook SDK - 远程定义FacebookAppID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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