正如我們所知的Facebook SDK,我們應該在App Plist中提供URL類型和FacebookAppID鍵。如何以編程方式存儲Facebook AppID密鑰
我的問題是如何以編程方式存儲它們,而無需在plist中手動輸入它們,例如在UIApplicationDelegate
方法didFinishLaunchingWithOptions
中。
我嘗試使用NSUserDefaults
設置它,但它保留給這個錯誤:
No AppID provided; either pass an AppID to init, or add a string valued key with the appropriate id named FacebookAppID to the bundle *.plist'
我不知道爲什麼,但我猜的Xcode店在其他地方使用NSUserDefaults
默認應用程序plist中鍵。
有誰知道如何解決這一問題?
謝謝@kokoko,但我需要寫不讀,並且我不知道爲什麼當我使用[[[NSBundle mainBundle] infoDictionary] objectForKey:@「FacebookAppID 「]? –
我編輯了我的答案。 – kokoko
我想我不能在plist(默認應用程序plist)上寫字,因爲[manager isWritableFileAtPath:plistPath]是NO ,,,我也嘗試過在plist上創建它來做一些測試並且它可以工作! –