Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

授权webview弹窗后立即消失 #6

Closed
yaokaige opened this issue Dec 10, 2013 · 12 comments
Closed

授权webview弹窗后立即消失 #6

yaokaige opened this issue Dec 10, 2013 · 12 comments

Comments

@yaokaige
Copy link

以前的版本中看到webview是通过加到UIWindow上实现的,而UIWindow是这样获得的:

UIWindow* window = [UIApplication sharedApplication].keyWindow; 

我的应用中是先弹出系统actionsheet(ios7)后让用户选择分享平台, 调试时发现这时候通过这样的方式获得的window为_UIAlertOverlayWindow类型
怀疑现在的sdk也是这样实现的,导致我的应用中授权webview无法显示,然后在我在请求授权之前加了这句代码:

[[[[UIApplication sharedApplication] delegate] window] makeKeyWindow];

结果webview能正常显示了......

@hongtaozhy
Copy link
Collaborator

用户选择分享平台 你应该等待alert消失之后再请求授权

  • (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex; // after animation
    否则keywindow的生命周期结束了 webview自然就消失了

@yaokaige
Copy link
Author

没错,是这样的。另外actionSheet的话,应该在这里请求授权

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex;  // after animation

@zjutwhw
Copy link

zjutwhw commented Apr 16, 2014

当手机上已经装了sina的客户端时,请求授权时跳转到sina客户端授权,但授权之后就不能跳转回自己的app,这是怎么回事?有没有朋友遇到这种情况。

但是如果手机本来没有装sina客户端,通过webview授权,一切正常。

@yaokaige
Copy link
Author

@zjutwhw 这种情况一般都是bundleID的问题,仔细看一下sdk的README

@zjutwhw
Copy link

zjutwhw commented Apr 19, 2014

@yaokaige 谢谢指教,文档里说的很清楚,是我自己没仔细阅读。

@yaoyaozhang
Copy link

我使用3.1.1的验证码登录,点击“获取验证码”直接弹出“错误”的alert

@sheaxu
Copy link

sheaxu commented Nov 11, 2015

Bundle ID填写是正确的,但是仍旧存在这个问题

@edwardean
Copy link

我现在存在和@sheaxu一样的问题,手机上没安装微博客户端时,授权页面弹出后授权后无反应,跳转的微博客户端授权后也没有任何反应,我的bundleID是正确的,请问这个是怎么回事?

@xylinuxkernel
Copy link

sso授权登陆,无客户端网页登陆成功后没有logout为什么每次点击授权都要重新来一遍 ,安装了客户端则不会这样 ,这是为什么,因为这个问题已经被苹果拒绝了

@huangwendong1988
Copy link

1、看看info.plist文件里有没添加加url types,在url schems里填上wb+APPKEY,如:wb8728171
2、微博平台上设置的bundle id 是否与你的应用一致

@wlflovesj
Copy link

客户端分享成功然后返回的时候崩溃了

@getgetsetset1
Copy link

ios swift, 我用github上最新的SDK进行认证,如果没有安装客户端的话无法弹出网页进行认证,why?, 如果安装了客户端就可以, 3Q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants