2014-02-10 83 views
2

我實現了在我的應用中使用Instagram登錄。我在Instagram上創建了一個應用程序&獲取客戶端ID &調用API的祕密密鑰。在IOS中動態添加URL方案

但是根據Instagram文檔,它每小時只有有限的API請求。

所以,How can I solve this?

My idea:我的一個解決方案是。用戶將創建他自己的Client ID & Secret Key,之後他將粘貼到應用程序中調用API。

但我的問題是,how can I add the this dynamic keys as a URL Schemes into the plist? 我從其中一個應用程序流出相同的Twitter API的想法。

任何幫助/解決方案/參考將不勝感激。

在此先感謝。

+0

根據這樣一個問題:http://stackoverflow.com/questions/12817272/editing-info-plist-possible-programmatically這是不可能的編輯info.plist文件。對不起:( – Apan

回答

-1

試試這個,但沒有測試..

NSDictionary *infoList = [[NSBundle mainBundle]infoDictionary];   

    NSDictionary *urlScheme=[[infoList valueForKey:@"CFBundleURLTypes"] objectAtIndex:0]; 

    NSLog(@"url scheme before:%@",urlScheme); 

    [urlScheme setValue:[NSArray arrayWithObject:@"New Scheme Name"] forKey:@"CFBundleURLSchemes"]; 

    NSLog(@"url scheme after:%@",urlScheme); 
+1

Info.plist文件是隻讀的。你也在上面的代碼中不斷變化的對象。 – Apan