2011-07-28 42 views
0

我使用的是SoundCloud Cocoa Wrapper API。要的SoundCloud帳戶連接用戶到他們的Facebook帳戶,我用這個:HTTP調用後從UIWeb視圖返回主視圖

[scAPI performMethod:@"POST" 
     onResource:@"connections" 
    withParameters:[NSDictionary dictionaryWithObjectsAndKeys: 
        @"facebook_profile", @"service", 
        @"http://imc", @"redirect_uri", 
        @"touch", @"display", //optional, forces services to use the mobile auth page if available 
        nil] 
      context:@"newConnection" 
      userInfo:nil]; 

這工作完全正常:我可以看到連接的SoundCloud我的連接設置頁面上進行。事情是一旦Facebook UIWebView頁面的工作,屏幕變白,它不會返回到我的應用程序的視圖。換句話說,UIWebView不會讓消息「走開」。我如何發送此消息?

任何想法?

編輯1個

其他一些信息,可以幫助:

#define kCallbackURL    @"imc://oauth"  //remember that the 
myapp protocol also is set in the info.plist 
PLIST URL identifier     com.imc 
PLIST URL Scheme Item 0   imc 

謝謝:)

回答

0

在Twitter的OAuth時,按以下方式進行。之後用戶按授權對UIWevView鍵,dismissModalViewControllerAnimated被稱爲關閉這一觀點:

if ([_delegate respondsToSelector: @selector(OAuthTwitterController:authenticatedWithUsername:)]) [_delegate OAuthTwitterController: self authenticatedWithUsername: _engine.username]; 
[self performSelector: @selector(dismissModalViewControllerAnimated:) withObject: (id) kCFBooleanTrue afterDelay: 1.0]; 

所以我想你應該寫這樣的事情:

[self performSelector: @selector(dismissModalViewControllerAnimated:) withObject: (id) kCFBooleanTrue afterDelay: 1.0]; 

你的工作與完成後調用web view