简体   繁体   English

每束Facebook iOS URL方案

[英]Per-bundleid Facebook iOS url scheme

I have encountered an unfortunate design issue with the Facebook iOS SDK. 我在使用Facebook iOS SDK时遇到了一个不幸的设计问题。 The problem is our company produces many branded apps from the same prototype codebase (think restaurant ordering) that all need to interact with the same Facebook app. 问题是我们公司使用相同的原型代码库(想像餐厅订购)生产了许多品牌应用程序,而这些都需要与相同的Facebook应用程序进行交互。

The problem is that if a user has multiple brands installed on their phone, the url schemes conflict and when authenticating from one app, the user may be returned to the wrong app! 问题是,如果用户的手机上安装了多个品牌,则网址方案会冲突,并且从一个应用程序进行身份验证时,该用户可能会返回到错误的应用程序!

I looked into Facebook's url scheme suffixes, but the documentation says multiple suffixes are searched in order (!), not relative to the corresponding bundle id. 我调查了Facebook的url方案后缀,但是文档说多个后缀是按顺序 (!)搜索的,而不是相对于相应的包ID而言的。 This is horrible. 这太可怕了。 If it simply associated a suffix with a particular bundle id, our problem would go away, but as it is documented, it will place precedence on certain brands over other brands, which is no better than the default behavior. 如果仅将后缀与特定的捆绑销售商ID相关联,我们的问题就会消失,但是正如所记录的那样,它将优先于某些品牌而不是其他品牌,这并不比默认行为好。

Is there any way to associate a url scheme suffix with a specific bundle id? 有什么方法可以将url方案后缀与特定的 bundle id相关联?

You can explicitly specify the suffix for each app by setting FacebookUrlSchemeSuffix in the application's plist. 您可以通过在应用程序的plist中设置FacebookUrlSchemeSuffix来为每个应用程序明确指定后缀。 When this happens, for the purposes of login and share dialog, the Facebook app will know the right suffix to use. 发生这种情况时,出于登录和共享对话框的目的,Facebook应用程序将知道要使用的正确后缀。

The only time it searches down the list of suffixes is for deep linking, which you may or may not use. 它向下搜索后缀列表的唯一一次是深度链接,您可能会使用也可能不会使用。

In any case, you might want to have different app IDs anyways as @WizKid recommends since you'll be able to get analytics for each app, and it also becomes easier to maintain. 无论如何,您都可能想像@WizKid所建议的那样拥有不同的应用程序ID,因为您将能够获取每个应用程序的分析数据,并且维护起来也变得更加容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM