0

我正在使用SoundCloud Cocoa Wrapper API。要将用户 SoundCloud 帐户连接到他们的 Facebook 帐户,我使用以下方法:

[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 

谢谢 :)

4

1 回答 1

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 视图完成工作后调用

于 2011-07-28T10:07:20.967 回答