authgear-server icon indicating copy to clipboard operation
authgear-server copied to clipboard

Webview reload on rotation causes bugs in AuthUI

Open fungc-io opened this issue 3 years ago • 7 comments

fungc-io avatar Jul 30 '21 03:07 fungc-io

@louischan-oursky is this issue done from the two merged PR?

fungc-io avatar Aug 06 '21 07:08 fungc-io

yes

louischan-oursky avatar Aug 06 '21 09:08 louischan-oursky

Reported by user:

On Android, changing orientation will crash the custom tab when the app is portrait only. @axolotl0212 fixed it by setting the orientation in Android "on create activity",

@louischan-oursky Can this be fixed in the SDK level? or do we need to mention this case in the doc?

See discussion here: https://github.com/oursky/hkland-agent-platform/issues/3047#issuecomment-1087128095

fungc-io avatar Apr 04 '22 06:04 fungc-io

If possible, we should allow the developer to configure our activities so that they can only be in portrait mode. The app will be consistent in the orientation it supports.

louischan-oursky avatar Apr 04 '22 07:04 louischan-oursky

If possible, we should allow the developer to configure our activities so that they can only be in portrait mode. The app will be consistent in the orientation it supports.

@louischan-oursky So we should change something in the SDK?

fungc-io avatar May 17 '22 08:05 fungc-io

Hi, just saw this issue. I don't know the details yet but I think we should strive to behave well in both orientation and be resilient to configuration change (screen density, orientation, language, etc) unless we are 100% sure it's a system bug. Could it be that our oauth/web view activity isn't handling configuration change properly? I can take a look at it.

roxk avatar May 17 '22 08:05 roxk

It seems that we are talking about two different unrelated things here.

First, AuthUI should support orientation change. Additionally it should still look nice in landscape orientation.

Second, allow the developer to force the webview in a particular orientation. On iOS, I guess ASWebAuthenticationSession will follow the orientation of the app. Nothing needs to be done by us. On Android, we use an Activity to show the webview. We declare this activity in the AndroidManifest.xml of the SDK. We do this because we want to streamline the setup of the SDK. In case the developer wants to change the properties of the Activity, they should be able to override the properties by declaring this activity in their AndroidManifest.xml. We need to make sure this approach work.

louischan-oursky avatar May 17 '22 08:05 louischan-oursky