1

This question could also be a general "How to change info.plist contents at compile-time" but I know it's a complex issue that is handled differently on iOS and MacOSX. The thing is that specifically when working with the Facebook SDK, it feels kind of wrong supplying my FB app-id twice - once in the "URL types" dictionary under "URL schemes" in the app's info.plist and once in my code. I want to be able to change the app-id dynamically from within my code without touching the info.plist file. I looked into Apple's launch services and found a potentially helpful "LSSetDefaultHandlerForURLScheme" method, only to find out that I was looking at the MAC developer library. I saw some other SO questions about this issue but the general opinion seems to be that this is not doable. Any ideas that don't involve pulling information out of the plist at compile time? (I want to be able to support several app-ids that are defined in a specific header file in my code).

Thanks!

Stavash
  • 14,244
  • 5
  • 52
  • 80
  • I dont know Why do you want to change the URL scheme for Facebook iOS sdk?It's already working fine i think so. – Dinesh Raja Apr 24 '12 at 10:25
  • Not an issue of wether it's working or not - I'm talking about the facebook application ID that you're supposed to define in the plist. This value is dependent on the app ID you get from Facebook when registering a new app (i.e fb225312434240296) – Stavash Apr 24 '12 at 11:26
  • Ofcourse you have to define it once in plist file.why do you want to change occassionally in runtime?? – Dinesh Raja Apr 24 '12 at 11:31
  • Because there is a possibility that I will want to work with a different FB app, client demand... – Stavash Apr 24 '12 at 11:32
  • http://stackoverflow.com/questions/2621515/how-to-save-a-value-in-a-plist-file-in-iphone – Dinesh Raja Apr 24 '12 at 11:47
  • There are ways of dynamically defining variables and referring to them via the info.plist, such as ${EXECUTABLE_NAME} – Stavash Apr 24 '12 at 11:49
  • You could also read and extract the FB ID from info.plist and use it in your header code. – Kent Nguyen May 14 '12 at 08:38

0 Answers0