V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
tylr
V2EX  ›  iDev

user should be able log in without opening Safari first

  •  2
     
  •   tylr · 2014-06-15 09:27:39 +08:00 · 3079 次点击
    这是一个创建于 3613 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我的第二个应用被拒了,原因是 ‘The app opens a web page in mobile Safari for logging in, then returns the user to the app. The user should be able log in without opening Safari first.‘

    我做的是一款调用Tumblr API的应用,用户初次使用点击Log In按钮后,会跳转到Safari中的Tumblr登录页面,登录并同意后便会回到应用,现在停火的Tinder也是用的一样的授权方式,但我的就给拒了(在申诉的时候我还真说的是为何Tinder行我不行,让再考虑下,目前还没有收到进一步的回复)。

    我在琢磨要怎么改,还望高人们给些指引,我想无非就两个方案:

    1. 估计也是审查者最中意的办法,即在uiview里面创建个username UITextField以及password UITextField,用户输入后post提交到Tumblr进行authentication。但这有可能吗?对于用户来说也太不安全了吧,这算是经常听到的跨域提交吗?

    2. 自己内嵌个UIWebView,通过将consumer_key和consumer_secret以post的方式在webView中加载request token的地 http://www.tumblr.com/oauth/request_token 从而获取OAuthToken和OAuthTokenSecret,但这和通过Safari没有本质的区别吧,也不知道能通过审核不
    第 1 条附言  ·  2014-06-16 16:21:06 +08:00
    已自己找到解决方案了!激动,这正是我喜欢编程的原因 :)
    3 条回复    2014-06-16 16:33:15 +08:00
    ahr0u
        1
    ahr0u  
       2014-06-15 23:45:13 +08:00
    我想授权在webView中完成,不用跳转到Safari中,我看了下TMTumblrSDK的代码,准备将该库中负责authenticate的代码(整个方法的代码如下)中的这句,[[UIApplication sharedApplication] openURL:authURL]; 改为创建UIwebView -> 添加到self.view中,然后[webView loadRequest:[NSURLRequest requestWithURL:authURL]];,但发现在这个第三方库中无法访问到viewController(从而无法self.view addSubview: webView),尝试了通过appDelegate来找到viewController,但也不行,请教这种情况该如何做呢?
    Olivia
        2
    Olivia  
    MOD
       2014-06-16 16:29:58 +08:00   ❤️ 1
    目前方法 2 是大部分 app 的方式。
    tylr
        3
    tylr  
    OP
       2014-06-16 16:33:15 +08:00
    @Olivia 谢谢Olivia,我最后也的确用的这种方式 :D
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   973 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 21:52 · PVG 05:52 · LAX 14:52 · JFK 17:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.