4

iOS Facebook SDK 3.0 を使用して、アプリの info.plist で FacebookAppID と関連する URL スキームを定義する必要があります。これらをリモートで定義したい (自分のサーバーにアプリ ID を要求する)。だから2つの異なる質問:

  1. 実行時にアプリの info.plist を変更できますか? または、別の plist で FacebookApID と URL スキームを定義して、plist を変更したり、新しいカスタム plist ファイルを作成したりできますか?
  2. Facebook SDK 3.0 の info.plist を使用する以外に、URL スキームとアプリ ID を定義する別の方法はありますか?
4

2 に答える 2

14

1.1 いいえ、実行時に Info.plist ファイルを変更することはできません。

1.2 いいえ、別の plist ファイルを読み込んで Info.plist の設定を上書きすることはできません。

2.1 はい、Info.plist ファイルを変更せずに FacebookApID を定義できます。Facebook iOS SDK のFBSettings.h[FBSettings setDefaultAppID:@"Your Facebook App ID"];のソース コードを参照してください。

2.2 いいえ、iOS が認識できるように、Info.plist で URL スキームを定義する必要があります。アプリのインストール時に iOS によって URL スキームが読み取られ、システム内の別の場所にキャッシュされると思います。Info.plist を変更できたとしても、システムは新しい URL スキームを取得しません。URL スキームを使用しない Facebook 認証の回避策があります。ログインに UIWebView を使用するように Facebook iOS SDK を強制できます。この stackoverflow questionを参照してください。

于 2013-07-20T14:41:49.360 に答える
2

This is not possible, for multiple reasons:

  1. You are not allowed to modify you iOS app's info.plist file at runtime.
  2. You should have a Facebook app running that you cant get the ID from long before you attempt to ship your app. How are you testing the app right now?
  3. The Facebook app ID is tied to the URL scheme the app uses to complete Facebook's OAuth flow. An iOS app's URL schemes are defined in the info.plist, which, again, you can't change.
  4. Being able to arbitrarily set the Facebook app ID is somewhat of a security issue, as it would make it trivial to pose as someone else's Facebook app.

These are just a handful I could think of off the top of my head, I'm sure there are many more.

于 2013-03-22T03:13:00.867 に答える