使用相同 Facebook 应用 ID 的两个 iOS 应用 - 可能吗? [英] Two iOS apps using the same Facebook app ID - is it possible?

查看:43
本文介绍了使用相同 Facebook 应用 ID 的两个 iOS 应用 - 可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用最新的 facebook iOS SDK(支持 SSO)将我的 iPhone 应用程序与 facebook 连接.到目前为止一切顺利..

I'm using the latest facebook iOS SDK (supporting SSO) to connect my iPhone app with facebook. So far so good..

由于我当前的应用程序是免费的,有广告,我想创建另一个没有广告的版本(我会收费).我不喜欢使用应用内购买方式.

Since my current app is free with ads, I would like to create another version without ads (which i will charge for). I prefer not to use the in-app purchase approach.

我面临的问题是,使用 facebook SSO,我需要将 iOS 应用程序绑定到基于 facebook 应用程序 ID 的 URL.由于我只有一个 facebook 应用程序可供两个 iphone 应用程序使用,这两个 iOS 应用程序绑定到相同的 URL,因此当它们都安装在设备上时,从 facebook 到我的应用程序的回调不起作用(或而是打开另一个应用程序).

The problem i'm facing is that with the facebook SSO, I need to bind the iOS application to a URL which is based on the facebook app ID. Since I have only one facebook app to be used by both of the iphone apps, the two iOS apps are binded to the same URL and therefore when both of them are installed on a device the callback from facebook to my app does not work (or opens the other app instead).

除了创建另一个专用于新版 iphone 应用的 facebook 应用之外,还有其他解决方案吗?

Is there a solution for that besides creating another facebook app dedicated to the new version of the iphone app?

谢谢.

推荐答案

在最新的 Facebook iOS SDK在 Github 上有一个方法叫做 authorize:delegate:localAppId: initWithAppId:urlSchemeSuffix:andDelegate:.您可以使用 localAppId urlSchemeSuffix 参数来区分使用相同 Facebook 应用程序 ID 的多个 iOS 应用程序.方法文档说:

In the latest Facebook iOS SDK on Github there's a method called authorize:delegate:localAppId: initWithAppId:urlSchemeSuffix:andDelegate:. You can use the localAppId urlSchemeSuffix parameter to distinguish multiple iOS Apps that use the same Facebook application id. The method documentation says:

urlSchemeSuffix 是一串小写字母,附加到用于 SSO 的基本 URL 方案.例如,如果您的 facebook ID 是350685531728"并且您将 urlSchemeSuffix 设置为abcd",Facebook 应用程序将期望您的应用程序绑定到以下 URL 方案:fb350685531728abcd".如果您有多个 iOS 应用程序共享一个 Facebook 应用程序 ID(例如,如果您在同一个应用程序上有免费和付费版本),并且您希望对这两个应用程序使用 SSO,这将非常有用.为这两个应用提供不同的 urlSchemeSuffix 值将允许 Facebook 应用消除其 URL 方案的歧义,并始终将用户重定向回正确的应用,即使设备上安装了免费应用和应用也是如此.

urlSchemeSuffix is a string of lowercase letters that is appended to the base URL scheme used for SSO. For example, if your facebook ID is "350685531728" and you set urlSchemeSuffix to "abcd", the Facebook app will expect your application to bind to the following URL scheme: "fb350685531728abcd". This is useful if your have multiple iOS applications that share a single Facebook application id (for example, if you have a free and a paid version on the same app) and you want to use SSO with both apps. Giving both apps different urlSchemeSuffix values will allow the Facebook app to disambiguate their URL schemes and always redirect the user back to the correct app, even if both the free and the app is installed on the device.

urlSchemeSuffix 支持 3.4.1 及以上版本的 Facebook 应用程序.如果用户安装了较旧版本的 Facebook 应用,并且您的应用使用了 urlSchemeSuffix 参数,则 SDK 会像设备上未安装 Facebook 应用一样继续操作,并将用户重定向到 Safari.

urlSchemeSuffix is supported on version 3.4.1 and above of the Facebook app. If the user has an older version of the Facebook app installed and your app uses urlSchemeSuffix parameter, the SDK will proceed as if the Facebook app isn't installed on the device and redirect the user to Safari.

这篇关于使用相同 Facebook 应用 ID 的两个 iOS 应用 - 可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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