IOS Facebook SDK - Remotely Detect FacebookAppID

When working with the iOS Facebook SDK 3.0, he needs to determine FacebookAppID and the corresponding URL scheme with it in the info.plist application. I want to define them remotely (request to my own server for application id). So, 2 different questions:

  • Is it possible to change application info.plist at runtime? Or can I define the FacebookApID and URL scheme in another plist, where can I change the plist or even create a new custom plist file?
  • Is there any other way to determine the URL scheme and application identifier other than using info.plist for the Facebook SDK 3.0?
+4
source share
2 answers

1.1 No, you cannot modify the Info.plist file at run time.

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

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

2.2 No. The URL scheme must be defined in Info.plist so that iOS can recognize it. I believe that the URL scheme is read by iOS when you install your application and is cached elsewhere on the system. Even if you can change your Info.plist, the system will not pick up your new URL scheme. But don’t worry, there is a workaround for Facebook authentication without using URL schemes! We can force the Facebook iOS SDK to use the UIWebView to log in, see fooobar.com/questions/1470897 / ....

+13
source

This is not possible for several reasons:

  • You are not allowed to modify the info.plist file of the iOS application at run time.
  • You must have a Facebook application in which you cannot get the identifier long before you try to submit your application. How are you testing the application right now?
  • The Facebook app ID is tied to the URL pattern that the app uses to complete the Facebook OAuth stream. The URL patterns of the iOS application are defined in the info.plist file, which, again, you cannot change.
  • The ability to arbitrarily set the Facebook application identifier is a security issue, as this would create a trivial view as an application for another Facebook.

This is just a handful with which I could think, but I am sure that there are many more.

+2
source

All Articles