[英]Change the display of Safari with ReactNativeKeycloak in-app browser options
I am trying to change the display of the following login with keycloak page.我正在尝试使用 keycloak 页面更改以下登录名的显示。 https://imgur.com/a/X18bmgC This shows up with Safari when starting the app.
https://imgur.com/a/X18bmgC这会在启动应用程序时与 Safari 一起显示。
The problem I have is that the user has to scroll to see the " New user " part of my WebView.我遇到的问题是用户必须滚动才能看到我的 WebView 的“新用户”部分。 And this is a problem.
这是一个问题。 I'd like to change the display of my WebView to make it look like this if possible : https://imgur.com/a/DYfpkRS Here I had to manually unzoom the page.
如果可能的话,我想更改我的 WebView 的显示以使其看起来像这样: https : //imgur.com/a/DYfpkRS这里我不得不手动取消缩放页面。
<ReactNativeKeycloakProvider
authClient={keycloak}
onEvent={onEvent}
initOptions={{
redirectUri: 'mobile://presentation',
inAppBrowserOptions: {
ephemeralWebSession: true,
modalEnabled: true,
},
}}>
This is the code displaying the Keycloak Login page in Safari ( https://github.com/react-keycloak/react-native-keycloak ).这是在 Safari ( https://github.com/react-keycloak/react-native-keycloak ) 中显示 Keycloak 登录页面的代码。 I've checked the different InAppBrowser options here : https://github.com/proyecto26/react-native-inappbrowser#ios-options
我在这里检查了不同的 InAppBrowser 选项: https : //github.com/proyecto26/react-native-inappbrowser#ios-options
When changing the values of each of these options, I can see no differences on the iPhone I'm using.当更改每个选项的值时,我在我使用的 iPhone 上看不到任何差异。 When I change 'ephemeralWebSession' from true to false, I can see the difference.
当我将 'ephemeralWebSession' 从 true 更改为 false 时,我可以看到不同之处。 But every other option makes no difference for me.
但其他所有选项对我来说都没有区别。 I tried to change 'modalTransitionStyle', 'modalPresentationStyle', 'readerMode' and 'preferredBarTintColor' values, but nothing shows different on the WebView.
我尝试更改 'modalTransitionStyle'、'modalPresentationStyle'、'readerMode' 和 'preferredBarTintColor' 值,但在 WebView 上没有显示任何不同。
I don't understand what I should change to get my WebView to change aswell.我不明白我应该改变什么才能让我的 WebView 也改变。
I realize this is about 6 months old as I'm writing this answer, but I had this same issue and came across this in a search.我意识到这是在我写这个答案时大约 6 个月大,但我遇到了同样的问题,并在搜索中遇到了这个问题。
There is an open issue with InAppBrowser that addresses this: https://github.com/proyecto26/react-native-inappbrowser/issues/292 InAppBrowser 有一个未解决的问题可以解决这个问题: https : //github.com/proyecto26/react-native-inappbrowser/issues/292
In short, RN Keycloak calls the InAppBrowser openAuth
method to start an ASWebAuthenticationSession
instead of a typical web session with the open
method.简而言之,RN Keycloak 调用 InAppBrowser
openAuth
方法来启动ASWebAuthenticationSession
而不是使用open
方法的典型 Web 会话。 ASWebAuthenticationSession
is not customizable, per Apple.根据 Apple,
ASWebAuthenticationSession
不可自定义。
So, the choice is to modify the RN Keycloak package to use the open
method, or to do some overriding trickery with Objective-C as found here: https://msolarana.netlify.app/2021/01/06/fixing-aswebauthenticationsession-presentation/因此,选择是修改 RN Keycloak 包以使用
open
方法,或者使用 Objective-C 执行一些覆盖技巧,如下所示: https : //msolarana.netlify.app/2021/01/06/fixing-aswebauthenticationsession -介绍/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.