Iphone HTTP调用后从UIWeb视图返回主视图
我在用电话。要将用户SoundCloud帐户连接到他们的Facebook帐户,我使用以下方法:Iphone HTTP调用后从UIWeb视图返回主视图,iphone,objective-c,xcode,http,soundcloud,Iphone,Objective C,Xcode,Http,Soundcloud,我在用电话。要将用户SoundCloud帐户连接到他们的Facebook帐户,我使用以下方法: [scAPI performMethod:@"POST" onResource:@"connections" withParameters:[NSDictionary dictionaryWithObjectsAndKeys: @"facebook_profile", @"service", @"h
[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
谢谢:)在Twitter OAuth中,它是通过以下方式完成的。用户按下UIWevView上的authorize按钮后,将调用DismissModalViewController来关闭该视图:
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完成工作后调用