苹果应用程序拒绝,因为Auth0 signUpLink在Cordova InAppBrowser中未打开,而是在系统浏览器(Safari)中打开,
我们的Ionic 2移动应用程序被苹果拒绝,原因如下:
我们注意到,用户被带到Safarilogin或注册一个帐户,这提供了一个糟糕的用户体验。 请修改您的应用,以便用户在应用中login或注册一个帐户。
Auth0 Lock为用户提供一个注册button,我们通过锁的signUpLink
选项来configuration。 此button会在应用程序外部的系统浏览器(Safari)中打开注册页面,这显然不适用于Apple。
在我们升级到Ionic 2(Ionic 2 beta 11)的最新版本之前,锁会打开InAppBrowser中的链接,苹果可以接受。 由于Ionic 2版本的不同,我想这可能是一个离子问题。
我确定我已经安装了Cordova InAppBrowser插件 。 它在我的config.xml文件中以<plugin name="cordova-plugin-inappbrowser" spec="~1.6.1" />
,当我在XCode中打开.xcproject文件时,插件出现在Plugins文件夹中。 我也使用open('https://www.google.com/, '_blank');
手动testing了InAppBrowser open('https://www.google.com/, '_blank');
这应该打开InAppBrowser。
关于Auth0 Lock的代码和注册页面的URL都没有改变。
Auth0 Lock版本:10.6(10.11也试过,没有解决的问题)
离子版本:2.1.0操作系统:iOS
自从Ionic 2testing版11以后,会有什么变化会影响在InAppBrowser中打开链接?
我已经想出了一个肮脏的临时解决方法,通过添加一个onclick
属性的button,打开window.open
函数中的链接:
this.lock.on('show', () => { let parent: Element = undefined; let intervalIndex = 0; let interval = setInterval(() => { parent = document.getElementsByClassName('auth0-lock-tabs')[0]; if (parent) { let item = parent.children.item(1).children.item(0); item.setAttribute('onclick', `window.open('${AppSettings.registrationUrl}', '_blank'); return false;`); item.removeAttribute('href'); clearInterval(interval); } if (intervalIndex == 20) clearInterval(interval); intervalIndex++; }, 500); });
通过此修改,注册链接将在InAppBrowser中打开,因此不再违反Apple的条款。
注意:这个问题不是一个好的解决办法,也不是一个有保证的解决方法,因为在button上configuration这个onclick属性是有延迟的。
- UIModalPresentationFormSheet的四舍五入
- IONIC 3 IOS无法从文件读取数据
- iPhone的iOS是有可能创build一个测距仪与2激光指针和iPhone?
- 围绕其中心旋转UIView保持其大小
- 离子2build立应用程序(IOS,Android)启动缓慢
- Angular 2应用程序库与cordovaIOS的href
- 只有底angular四舍五入
- 如何在UIImageView的左上angular和右下angular创buildUIButton
- 如何获得UITableViewCell的圆angular边缘的方式,允许用户select单元格背景颜色? (但不使用GROUPED模式)