简体   繁体   English

使用 ReactNativeKeycloak 应用程序内浏览器选项更改 Safari 的显示

[英]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.

相关问题 应用内浏览器-如果页面未加载-显示消息 - In-App Browser - if the page is not loading - Display message 应用内Safari浏览器是否支持会员链接的cookie? - Does the in-app Safari browser support cookies for affiliate links? iOS 应用内浏览器 - iOS in-App browser iOS-如何在默认浏览器(Safari或Chrome)而非应用内浏览器中打开链接? - iOS - How to open the links in the default browser (Safari or Chrome) instead of the in-app browser? 如何制作在Safari中为iOS Facebook Messenger Messenger应用而不是应用内网络浏览器打开的URL - How to make url that open in Safari for iOS Facebook Messenger app instead of in-app web browser 带有来自相机的输入的视频标签可在 iOS 上的 Safari 中运行,但既不能在 Chrome 中也不能在任何应用内浏览器中运行 - Video tag with input from Camera is Working in Safari on iOS but neither working in Chrome nor in any In-app Browser Safari中的iOS开放网址,而不是Facebook应用内浏览器JS,HTML - iOS open URL in safari instead of Facebook in-app browser JS, HTML React Native应用内浏览器应用 - React Native in-app browser app iOS应用程式内语言变更 - iOS in-app language change Facebook登录无法使用iOS应用内浏览器 - Facebook login is not working In-app browser for iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM